scst: Fix locking annotations

Avoid that the following warnings are triggered:

WARNING: CPU: 5 PID: 32343 at scst/src/scst_copy_mgr.c:2741 scst_cm_on_add_acg+0x12d/0x180 [scst]
Call Trace:
 [<ffffffff812a4d23>] dump_stack+0x86/0xc3
 [<ffffffff8106412b>] __warn+0xcb/0xf0
 [<ffffffff8106421d>] warn_slowpath_null+0x1d/0x20
 [<ffffffffa04f9b0d>] scst_cm_on_add_acg+0x12d/0x180 [scst]
 [<ffffffffa04b8084>] scst_alloc_add_acg+0xc4/0x280 [scst]
 [<ffffffffa0486b30>] scst_register_target+0x190/0x3a0 [scst]
 [<ffffffffa054f2de>] scst_cm_init+0xb8/0xdda [scst]
 [<ffffffffa054eab9>] init_scst+0xa06/0xc3f [scst]
 [<ffffffff8100043d>] do_one_initcall+0x3d/0x160
 [<ffffffff81154ae0>] do_init_module+0x5f/0x1f1
 [<ffffffff810efa69>] load_module+0x2719/0x2a50
 [<ffffffff810effcc>] SYSC_finit_module+0xbc/0xf0
 [<ffffffff810f001e>] SyS_finit_module+0xe/0x10
 [<ffffffff8152fe40>] entry_SYSCALL_64_fastpath+0x23/0xc1

WARNING: CPU: 2 PID: 12885 at scst/src/scst_copy_mgr.c:2826 scst_cm_check_access_acg+0x180/0x1e0 [scst]
Call Trace:
 [<ffffffff812a4d23>] dump_stack+0x86/0xc3
 [<ffffffff8106412b>] __warn+0xcb/0xf0
 [<ffffffff8106421d>] warn_slowpath_null+0x1d/0x20
 [<ffffffffa0502b00>] scst_cm_check_access_acg+0x180/0x1e0 [scst]
 [<ffffffffa0502cba>] scst_cm_check_access+0x15a/0x280 [scst]
 [<ffffffffa05030cb>] scst_cm_parse_id_tgt_descr+0x2eb/0x590 [scst]
 [<ffffffffa050a1d8>] scst_cm_parse_descriptors+0x308/0xa60 [scst]
 [<ffffffffa04d4440>] scst_parse_descriptors+0x60/0x130 [scst]
 [<ffffffffa04a3c05>] scst_tgt_pre_exec+0x375/0x4a0 [scst]
 [<ffffffffa04ac2a9>] scst_process_active_cmd+0x439/0x740 [scst]
 [<ffffffffa04adbb2>] scst_cmd_thread+0x202/0x6a0 [scst]
 [<ffffffff810883cf>] kthread+0xef/0x110
 [<ffffffff8153008f>] ret_from_fork+0x1f/0x40


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7097 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2017-02-24 07:07:41 +00:00
parent ab0e7cc0be
commit 95fe66fbeb
2 changed files with 3 additions and 3 deletions
+1 -2
View File
@@ -2738,7 +2738,6 @@ int scst_cm_on_add_acg(struct scst_acg *acg)
TRACE_ENTRY();
scst_assert_activity_suspended();
lockdep_assert_held(&scst_mutex);
if (scst_cm_tgt == NULL)
@@ -2824,7 +2823,7 @@ static bool scst_cm_check_access_acg(const char *initiator_name,
TRACE_ENTRY();
scst_assert_activity_suspended();
lockdep_assert_held(&scst_mutex);
lockdep_assert_held(&scst_mutex2);
list_for_each_entry(acg_dev, &acg->acg_dev_list, acg_dev_list_entry) {
if (acg_dev->dev == dev) {
+2 -1
View File
@@ -4590,7 +4590,6 @@ out:
return res;
}
/* The activity supposed to be suspended and scst_mutex held */
int scst_alloc_add_acg(struct scst_tgt *tgt, const char *acg_name,
bool tgt_acg, struct scst_acg **out_acg)
{
@@ -4599,6 +4598,8 @@ int scst_alloc_add_acg(struct scst_tgt *tgt, const char *acg_name,
TRACE_ENTRY();
lockdep_assert_held(&scst_mutex);
acg = kzalloc(sizeof(*acg), GFP_KERNEL);
if (acg == NULL) {
PRINT_ERROR("%s", "Allocation of acg failed");