mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-21 14:46:23 +00:00
scst: Fix a runtime warning
WARNING: CPU: 5 PID: 20857 at kernel/sched/core.c:7533 __might_sleep+0x82/0x90() do not call blocking ops when !TASK_RUNNING; state=2 set at [<ffffffff81098c13>] prepare_to_wait_event+0x63/0x110 CPU: 5 PID: 20857 Comm: rmmod Tainted: G OE 4.4.0-rc3+ #1 Call Trace: [<ffffffff81251bcb>] dump_stack+0x4f/0x74 [<ffffffff810574cb>] warn_slowpath_common+0x8b/0xd0 [<ffffffff810575b1>] warn_slowpath_fmt+0x41/0x70 [<ffffffff81080562>] __might_sleep+0x82/0x90 [<ffffffff815187f3>] mutex_lock_nested+0x33/0x380 [<ffffffffa05033ca>] test_sess_list+0x1a/0x40 [scst] [<ffffffffa050794a>] scst_unregister_target+0x36a/0x380 [scst] [<ffffffffa09259f1>] srpt_remove_one+0xb1/0x150 [ib_srpt] [<ffffffffa0145a15>] ib_unregister_client+0xe5/0x190 [ib_core] [<ffffffffa09297ea>] srpt_cleanup_module+0x26/0x34 [ib_srpt] [<ffffffff810dfc9b>] SyS_delete_module+0x17b/0x1c0 [<ffffffff8151b617>] entry_SYSCALL_64_fastpath+0x12/0x6f Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
+1
-11
@@ -593,16 +593,6 @@ out_free_tgt:
|
||||
}
|
||||
EXPORT_SYMBOL(scst_register_target);
|
||||
|
||||
static inline int test_sess_list(struct scst_tgt *tgt)
|
||||
{
|
||||
int res;
|
||||
|
||||
mutex_lock(&scst_mutex);
|
||||
res = list_empty(&tgt->sysfs_sess_list);
|
||||
mutex_unlock(&scst_mutex);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* scst_unregister_target() - unregister target.
|
||||
*
|
||||
@@ -656,7 +646,7 @@ again:
|
||||
#endif
|
||||
|
||||
TRACE_DBG("%s", "Waiting for sessions shutdown");
|
||||
wait_event(tgt->unreg_waitQ, test_sess_list(tgt));
|
||||
wait_event(tgt->unreg_waitQ, list_empty(&tgt->sysfs_sess_list));
|
||||
TRACE_DBG("%s", "wait_event() returned");
|
||||
|
||||
scst_suspend_activity(SCST_SUSPEND_TIMEOUT_UNLIMITED);
|
||||
|
||||
Reference in New Issue
Block a user