diff options
author | Quinn Tran <qutran@marvell.com> | 2019-09-12 11:09:06 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-09-23 23:09:42 -0400 |
commit | c3b6a1d397420a0fdd97af2f06abfb78adc370df (patch) | |
tree | c04565b5d2d375d7b0d0f1bc0a0c4103d4472aa2 /drivers/scsi | |
parent | 248a445adfc8c33ffd67cf1f2e336578e34f9e21 (diff) | |
download | linux-c3b6a1d397420a0fdd97af2f06abfb78adc370df.tar.gz linux-c3b6a1d397420a0fdd97af2f06abfb78adc370df.tar.bz2 linux-c3b6a1d397420a0fdd97af2f06abfb78adc370df.zip |
scsi: qla2xxx: Fix unbound sleep in fcport delete path.
There are instances, though rare, where a LOGO request cannot be sent out
and the thread in free session done can wait indefinitely. Fix this by
putting an upper bound to sleep.
Link: https://lore.kernel.org/r/20190912180918.6436-3-hmadhani@marvell.com
Signed-off-by: Quinn Tran <qutran@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 0ffda6171614..b58ecd2d7fb6 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1020,6 +1020,7 @@ void qlt_free_session_done(struct work_struct *work) if (logout_started) { bool traced = false; + u16 cnt = 0; while (!READ_ONCE(sess->logout_completed)) { if (!traced) { @@ -1029,6 +1030,9 @@ void qlt_free_session_done(struct work_struct *work) traced = true; } msleep(100); + cnt++; + if (cnt > 200) + break; } ql_dbg(ql_dbg_disc, vha, 0xf087, |