qla2x00t-32gbit: 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>

[ commit c3b6a1d397420a0fdd97af2f06abfb78adc370df upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8640 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-11-03 00:22:14 +00:00
parent be26597a48
commit bbd83a6ad1

View File

@@ -1033,6 +1033,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) {
@@ -1042,6 +1043,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,