Skip to content

Commit

Permalink
scsi: qla2xxx: Fix unbound sleep in fcport delete path.
Browse files Browse the repository at this point in the history
[ Upstream commit c3b6a1d397420a0fdd97af2f06abfb78adc370df ]

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/[email protected]
Signed-off-by: Quinn Tran <[email protected]>
Signed-off-by: Himanshu Madhani <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Quinn Tran authored and gregkh committed Oct 29, 2019
1 parent c3d475c commit fcff55e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/scsi/qla2xxx/qla_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -1023,6 +1023,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) {
Expand All @@ -1032,6 +1033,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,
Expand Down

0 comments on commit fcff55e

Please sign in to comment.