mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-16 10:11:28 +00:00
62fffa45dca89dc87e8d75b360a995db334af9ac
could trigger a deadlock This patch causes lockdep to complain if sysfs work could trigger a deadlock. As an example, for the patch below the following lockdep complaint is generated: ====================================================== [ INFO: possible circular locking dependency detected ] 3.12.0-rc7-dbg+ #5 Tainted: GF O ------------------------------------------------------- scst_mgmtd/7527 is trying to acquire lock: (scst_tgt_dev){+.+.+.}, at: [<ffffffffa01f9365>] scst_tgt_dev_sysfs_del+0x105/0x1a0 [scst] but task is already holding lock: (&scst_mutex){+.+.+.}, at: [<ffffffffa01eaa46>] scst_free_session+0x56/0x2c0 [scst] which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&scst_mutex){+.+.+.}: [<ffffffff810be983>] lock_acquire+0x93/0x150 [<ffffffff81619617>] mutex_lock_interruptible_nested+0x77/0x500 [<ffffffffa01f1f9f>] scst_tgt_dev_process_thread_pid_show+0x5f/0x120 [scst] [<ffffffffa01f38d6>] scst_process_sysfs_works+0xe6/0x1d0 [scst] [<ffffffffa01f7af0>] sysfs_work_thread_fn+0x120/0x2b0 [scst] [<ffffffff8107482a>] kthread+0xea/0xf0 [<ffffffff81625f6c>] ret_from_fork+0x7c/0xb0 -> #0 (scst_tgt_dev){+.+.+.}: [<ffffffff810bdc8a>] __lock_acquire+0x14fa/0x1a60 [<ffffffff810be983>] lock_acquire+0x93/0x150 [<ffffffffa01f20df>] scst_kobject_put_and_wait+0x6f/0x140 [scst] [<ffffffffa01f9365>] scst_tgt_dev_sysfs_del+0x105/0x1a0 [scst] [<ffffffffa01e9114>] scst_free_tgt_dev+0x84/0x210 [scst] [<ffffffffa01ea80b>] scst_sess_free_tgt_devs+0x6b/0x100 [scst] [<ffffffffa01eaa4e>] scst_free_session+0x5e/0x2c0 [scst] [<ffffffffa01ead4e>] scst_free_session_callback+0x9e/0x170 [scst] [<ffffffffa01d5a9a>] scst_global_mgmt_thread+0x24a/0x550 [scst] [<ffffffff8107482a>] kthread+0xea/0xf0 [<ffffffff81625f6c>] ret_from_fork+0x7c/0xb0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&scst_mutex); lock(scst_tgt_dev); lock(&scst_mutex); lock(scst_tgt_dev); *** DEADLOCK *** 1 lock held by scst_mgmtd/7527: #0: (&scst_mutex){+.+.+.}, at: [<ffffffffa01eaa46>] scst_free_session+0x56/0x2c0 [scst] stack backtrace: CPU: 1 PID: 7527 Comm: scst_mgmtd Tainted: GF O 3.12.0-rc7-dbg+ #5 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013 ffffffff822efd40 ffff88007b7c1ac8 ffffffff8161464a ffffffff822efd40 ffff88007b7c1b08 ffffffff81610d02 ffff88007b7c1b60 ffff8800692748c0 0000000000000000 ffff880069274898 ffff880069274120 ffff8800692748c0 Call Trace: [<ffffffff8161464a>] dump_stack+0x4e/0x82 [<ffffffff81610d02>] print_circular_bug+0x201/0x210 [<ffffffff810bdc8a>] __lock_acquire+0x14fa/0x1a60 [<ffffffff810be983>] lock_acquire+0x93/0x150 [<ffffffffa01f9365>] ? scst_tgt_dev_sysfs_del+0x105/0x1a0 [scst] [<ffffffffa01f20df>] scst_kobject_put_and_wait+0x6f/0x140 [scst] [<ffffffffa01f9365>] ? scst_tgt_dev_sysfs_del+0x105/0x1a0 [scst] [<ffffffffa01f9365>] scst_tgt_dev_sysfs_del+0x105/0x1a0 [scst] [<ffffffffa01e9114>] scst_free_tgt_dev+0x84/0x210 [scst] [<ffffffffa01ea80b>] scst_sess_free_tgt_devs+0x6b/0x100 [scst] [<ffffffffa01eaa4e>] scst_free_session+0x5e/0x2c0 [scst] [<ffffffffa01ead4e>] scst_free_session_callback+0x9e/0x170 [scst] [<ffffffffa01d5a9a>] scst_global_mgmt_thread+0x24a/0x550 [scst] [<ffffffff81075850>] ? wake_up_atomic_t+0x30/0x30 [<ffffffffa01d5850>] ? scst_register_session_non_gpl+0x20/0x20 [scst] [<ffffffff8107482a>] kthread+0xea/0xf0 [<ffffffff81074740>] ? kthread_create_on_node+0x140/0x140 [<ffffffff81625f6c>] ret_from_fork+0x7c/0xb0 [<ffffffff81074740>] ? kthread_create_on_node+0x140/0x140 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5095 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This is the SCST development repository. It contains not a single project SCST as one can think, but a number of them, which are divided as the following: 1. SCST core in scst/ subdirectory 2. Administration utility for SCST core scstadmin in scstadmin/ 3. Target drivers in own subdirectories qla2x00t/, iscsi-scst/, etc. 4. User space programs in usr/ subdirectory, like fileio_tgt. 5. Some various docs in doc/ subdirectory. Those subprojects are in most cases independent from each other, although some of them depend from the SCST core. They put in the single repository only to simplify their development, they are released independently. Thus, use "make all" only if you really need to build everything. Otherwise build only what you need, like for iSCSI-SCST: make scst scst_install iscsi iscsi_install For more information about each subproject see their README files. Vladislav Bolkhovitin <vst@vlnb.net>, http://scst.sourceforge.net
Description
Languages
C
90.1%
Perl
4.2%
Shell
1.8%
HTML
1.7%
Makefile
1.2%
Other
0.9%