From: Mike Christie <michaelc@xxxxxxxxxxx> In some code paths we had the fl_lock when calling tt.rport_lookup_create. tt.rport_lookup_create can sleep if it needs to create a new rport (fc class uses GFP_KERNEL for example), so we need to have the spin locks dropped. Signed-off-by: Mike Christie <michaelc@xxxxxxxxxxx> --- drivers/scsi/libfc/fc_disc.c | 7 +++++++ drivers/scsi/libfc/fc_lport.c | 7 +++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index 45210c3..a1b5171 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c @@ -907,7 +907,14 @@ static void fc_disc_enter_dns(struct fc_lport *lp) /* * Set up remote port to directory server. */ + + /* + * we are called with the fl_lock, but if rport_lookup_create + * needs to create a rport then it will sleep. + */ + spin_unlock_bh(&lp->fl_lock); rp = lp->tt.rport_lookup_create(lp, &ids); + spin_lock_bh(&lp->fl_lock); if (!rp) goto err; lp->tt.sess_init(lp, rp); diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index e3eae92..a7ffab7 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c @@ -177,7 +177,14 @@ static void fc_lport_ptp_setup(struct fc_lport *lp, .node_name = remote_wwnn, }; + + /* + * if we have to create a rport the fc class can sleep so we must + * drop the lock here + */ + spin_unlock_bh(&lp->fl_lock); rp = lp->tt.rport_lookup_create(lp, &ids); + spin_lock_bh(&lp->fl_lock); if (rp) { if (lp->fl_ptp_rp) lp->tt.rport_release(lp->fl_ptp_rp); -- 1.5.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html