Whamcloud - gitweb
LU-4624 llite: Avoid statahead thread start/stop deadlocks 82/12182/2
authorChristopher J. Morrone <morrone2@llnl.gov>
Fri, 21 Feb 2014 22:46:47 +0000 (14:46 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 11 Oct 2014 04:43:52 +0000 (04:43 +0000)
commit3602066d87f951faa4d89832154db73f82242563
treef65180109a1623f72e349305725443d58899219d
parent5ba64fb4127f299dc19764d6c94b2068bd9c90ae
LU-4624 llite: Avoid statahead thread start/stop deadlocks

The statahead and statahead agl threads blindly set their
thread state to SVC_RUNNING without checking the state first.  If, for
instance, another thread sets the state to SVC_STOPPING that
stop signal will now have been lost.  Deadlock ensues.

We also partly improve the sai reference counting, because a race exists
where the ll_stop_statahead thread can drop the default reference, and
the statahead thread can exit and drop its reference as well.  With no
references on the sai, the final put will poison and free the buffer.  The
original do_statahead_enter() function may then continue to access
the buffer after it is freed because it did not take a reference of its
own.  We add a local reference to address that.

Lustre-commit: 373d937086e5cede6fc1a3b3f859622c0173c1de
Lustre-change: http://review.whamcloud.com/9358

Change-Id: I531f17966d49ba1e6ebd99abe9cb8b128eeac4f9
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/12182
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/llite/statahead.c