Vladislav Bolkhovitin b39b5d8502 scst_main: Fix race between scst_resume_activity() and scst_init_thread()
After SCST_FLAG_SUSPENDED has been cleared it is essential that
scst_do_job_init() reexamines scst_init_cmd_list to avoid that
commands get stuck in the command init list. This patch fixes the
following race condition that can occur if SCST_FLAG_SUSPENDED
has been set and if scst_init_cmd_list is not empty:
* scst_do_job_init() returns to scst_init_thread() and leaves the
  commands that were on the init list on that list.
* scst_init_thread() invokes test_init_cmd_list().
* test_init_cmd_list() returns false because SCST_FLAG_SUSPENDED
  has been set.
* scst_resume_activity() clears SCST_FLAG_SUSPENDED and invokes
  wake_up_all(&scst_init_cmd_list_waitQ). However, since
  scst_init_thread() has not yet added the init thread back to
  scst_init_cmd_list_waitQ this wake_up_all() call doesn't do
  anything.
* scst_init_thread() adds the init thread to scst_init_cmd_list_waitQ
  and unlocks scst_init_lock.

Additionally, remove an unneeded smp_mb__after_clear_bit() call.
wake_up_all() guarantees that if it wakes up a thread that that
thread sees all store operations that were performed by the thread
that invoked wake_up_all() and that preceeded the wake_up_all()
invocation.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5524 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-05-17 01:04:08 +00:00
2014-05-02 02:50:34 +00:00
2014-05-10 03:55:11 +00:00
2011-04-19 22:56:07 +00:00
2014-02-24 07:30:50 +00:00
2008-06-26 16:35:10 +00:00

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
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%