mirror of
https://github.com/SCST-project/scst.git
synced 2026-09-19 14:34:18 +00:00
scst: Fix race between closing a session and adding a LUN
Fixes this call stack (kernel 3.2.15): WARNING: at lib/kref.c:34 kref_get+0x2d/0x30() Hardware name: X8ST3 Modules linked in: scst_vdisk ib_srpt scst Pid: 2159, comm: scst_uid Tainted: G W 3.2.15-07+ #2 Call Trace: [<ffffffff81059cba>] warn_slowpath_common+0x7a/0xb0 [<ffffffff81059d05>] warn_slowpath_null+0x15/0x20 [<ffffffff812a5d7d>] kref_get+0x2d/0x30 [<ffffffff812a46ba>] kobject_get+0x1a/0x30 [<ffffffff812a471b>] kobject_add_internal+0x4b/0x240 [<ffffffff812a4bf3>] kobject_init_and_add+0x63/0x90 [<ffffffffa001082b>] ? scst_tgt_dev_setup_threads+0xab/0x310 [scst] [<ffffffffa001a722>] scst_tgt_dev_sysfs_create+0x42/0x80 [scst] [<ffffffffa0010e8c>] scst_alloc_add_tgt_dev+0x31c/0x4b0 [scst] [<ffffffffa001362e>] scst_acg_add_lun+0xfe/0x230 [scst] [<ffffffff812b4511>] ? _kstrtoull+0x31/0x90 [<ffffffffa001777c>] scst_luns_mgmt_store_work_fn+0x29c/0x6b0 [scst] [<ffffffffa0019634>] sysfs_work_thread_fn+0xd4/0x2e0 [scst] [<ffffffff8107a020>] ? wake_up_bit+0x40/0x40 [<ffffffffa0019560>] ? scst_tgt_cpu_mask_show+0x20/0x20 [scst] [<ffffffff81079ab6>] kthread+0x96/0xa0 [<ffffffff8163d7b4>] kernel_thread_helper+0x4/0x10 [<ffffffff81079a20>] ? kthread_worker_fn+0x190/0x190 [<ffffffff8163d7b0>] ? gs_change+0x13/0x13 Reported-by: Sebastian Riemer <sebastian.riemer@profitbricks.com> (Merge r4452:4456 and r4464 from trunk). git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4506 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1445,6 +1445,12 @@ struct scst_tgt {
|
||||
/* List of remote sessions per target, protected by scst_mutex */
|
||||
struct list_head sess_list;
|
||||
|
||||
/*
|
||||
* List of remote sessions registered in sysfs per target, protected
|
||||
* by scst_mutex.
|
||||
*/
|
||||
struct list_head sysfs_sess_list;
|
||||
|
||||
/* List entry of targets per template (tgts_list) */
|
||||
struct list_head tgt_list_entry;
|
||||
|
||||
@@ -1609,9 +1615,15 @@ struct scst_session {
|
||||
/* Name of attached initiator */
|
||||
const char *initiator_name;
|
||||
|
||||
/* Unique session name: initiator name + optional _%d. */
|
||||
const char *sess_name;
|
||||
|
||||
/* List entry of sessions per target */
|
||||
struct list_head sess_list_entry;
|
||||
|
||||
/* Per target list entry for sessions registered in sysfs. */
|
||||
struct list_head sysfs_sess_list_entry;
|
||||
|
||||
/* List entry for the list that keeps session, waiting for the init */
|
||||
struct list_head sess_init_list_entry;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user