Vladislav Bolkhovitin 33627cc8d8 When trying to remove a megaraid_sas device, the scst will hang inside
scst_free_device:

[  380.448608] [4]: scst: Detached from scsi0, channel 2, id 1, lun 0, type 0
[  601.138688] INFO: task kworker/0:0:4 blocked for more than 120 seconds.
[  601.138756]       Tainted: P           OE  3.19.0-58-quantastor #64~14.04.1
[  601.138810] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  601.138869] kworker/0:0     D ffff88085c6fba58     0     4      2 0x00000000
[  601.138926] Workqueue: events megasas_aen_polling [megaraid_sas]
[  601.138930]  ffff88085c6fba58 ffff88085c6f09d0 0000000000013e80 ffff88085c6fbfd8
[  601.138934]  0000000000013e80 ffffffff81c1d4e0 ffff88085c6f09d0 ffff88085c6fba38
[  601.138938]  ffff88085c6fbbd8 7fffffffffffffff ffff88085c6fbbd0 ffff88085c6f09d0
[  601.138942] Call Trace:
[  601.138955]  [<ffffffff817b5469>] schedule+0x29/0x70
[  601.138960]  [<ffffffff817b8574>] schedule_timeout+0x244/0x2c0
[  601.138968]  [<ffffffff8115fbcb>] ? irq_work_queue+0x6b/0x90
[  601.138975]  [<ffffffff810cb8e2>] ? wake_up_klogd+0x32/0x40
[  601.138979]  [<ffffffff810cbaf8>] ? console_unlock+0x208/0x480
[  601.138983]  [<ffffffff817b61c4>] wait_for_completion+0xa4/0x170
[  601.138989]  [<ffffffff810a1ea0>] ? wake_up_state+0x20/0x20
[  601.138995]  [<ffffffff8108d94c>] flush_workqueue+0x10c/0x5b0
[  601.139002]  [<ffffffff8108de05>] flush_scheduled_work+0x15/0x20
[  601.139044]  [<ffffffffc09314f6>] scst_free_device+0x16/0x50 [scst]
[  601.139051]  [<ffffffffc091a86f>] scst_remove+0x2df/0x3a0 [scst]
[  601.139056]  [<ffffffffc028c093>] ? enclosure_find+0x93/0xa0 [enclosure]
[  601.139061]  [<ffffffff814f3971>] device_del+0xe1/0x270
[  601.139062]  [<ffffffff814f3b22>] device_unregister+0x22/0x70
[  601.139066]  [<ffffffff815549ab>] __scsi_remove_device+0xbb/0xd0
[  601.139068]  [<ffffffff815549e6>] scsi_remove_device+0x26/0x40
[  601.139074]  [<ffffffffc039fb22>] megasas_aen_polling+0x362/0x610 [megaraid_sas]
[  601.139076]  [<ffffffff8108eeaf>] process_one_work+0x14f/0x440
[  601.139077]  [<ffffffff8108fab8>] worker_thread+0x118/0x510
[  601.139079]  [<ffffffff8108f9a0>] ? rescuer_thread+0x3d0/0x3d0
[  601.139082]  [<ffffffff81094b49>] kthread+0xc9/0xe0
[  601.139084]  [<ffffffff81094a80>] ? kthread_create_on_node+0x1c0/0x1c0
[  601.139087]  [<ffffffff817b9798>] ret_from_fork+0x58/0x90
[  601.139089]  [<ffffffff81094a80>] ? kthread_create_on_node+0x1c0/0x1c0

The problem is that scst_free_device will call flush_scheduled_work to wait
for ext_blockers_work, but scst_free_device itself is called from
schedule_work, thus creating deadlock.

Instead of using heavy-handed flush_scheduled_work, we use flush_work to wait
for ext_blockers_work to finish.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6883 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-05-04 02:43:06 +00:00
2016-01-22 03:08:44 +00:00
2016-04-20 02:48:28 +00:00
2016-02-18 03:15:53 +00:00
2011-04-19 22:56:07 +00:00

Overview
========

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.


QLogic target driver
====================

QLogic target driver qla2x00t is the old driver, forked from qla2xxx
several years ago. It is very stable, well tested and actively used in
many production setups. The ultimate goal is to have the mainstream
(git) QLogic target driver to be the main and the only QLogic target
driver, but, unfortunately, this driver not yet reached level of quality
and maturity of qla2x00t. We with QLogic are working toward it.

You can find the latest version of the git driver in git://git.qlogic.com/scst-qla2xxx.git.
It is maintained by QLogic, hence located in the QLogic's git.

To integrate it into the SCST build tree you need:

1. Clone the QLogic git tree somewhere in your system.

2. Create in the SCST root, i.e. this directory, a subdirectory with name
qla2x00t_git

3. Optional for the in-tree build: symlink drivers/scsi/qla2xxx
subdirectory in the cloned git tree to the qla2x00t_git subdirectory

Thats all. Now common and QLA specific root Makefile targets "magically"
start working with the new driver.

For detail instructions how to setup QLA target build environment see
its README or HOWTO. Run either "make all" to build the SCST core and
all target drivers with in-tree QLogic drivers, or the following command
with standalone QLogic drivers:

BUILD_2X_MODULE=y CONFIG_SCSI_QLA_FC=y CONFIG_SCSI_QLA2XXX_TARGET=y make all

In presence of qla2x00t_git subdirectory you can still build the
qla2x00t using qla_old* root Makefile targets.

Vladislav Bolkhovitin <vst@vlnb.net>, http://scst.sourceforge.net
Description
No description provided
Readme 33 MiB
Languages
C 90.1%
Perl 4.2%
Shell 1.8%
HTML 1.7%
Makefile 1.2%
Other 0.9%