Skip to content

Commit c3b6a1d

Browse files
Quinn Tranmartinkpetersen
authored andcommitted
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/[email protected] Signed-off-by: Quinn Tran <[email protected]> Signed-off-by: Himanshu Madhani <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 248a445 commit c3b6a1d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/scsi/qla2xxx/qla_target.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ void qlt_free_session_done(struct work_struct *work)
10201020

10211021
if (logout_started) {
10221022
bool traced = false;
1023+
u16 cnt = 0;
10231024

10241025
while (!READ_ONCE(sess->logout_completed)) {
10251026
if (!traced) {
@@ -1029,6 +1030,9 @@ void qlt_free_session_done(struct work_struct *work)
10291030
traced = true;
10301031
}
10311032
msleep(100);
1033+
cnt++;
1034+
if (cnt > 200)
1035+
break;
10321036
}
10331037

10341038
ql_dbg(ql_dbg_disc, vha, 0xf087,

0 commit comments

Comments
 (0)