Whamcloud - gitweb
LU-10134 lfsck: not add requests if engine out of work 75/30375/3
authorFan Yong <fan.yong@intel.com>
Wed, 22 Nov 2017 02:38:43 +0000 (10:38 +0800)
committerJohn L. Hammond <john.hammond@intel.com>
Thu, 4 Jan 2018 17:21:59 +0000 (17:21 +0000)
commit02065756c83057d3acc35792b744078f2739025d
tree4395b780e5a2cec26e31a19d552bc74c476015fa
parent7c04a652f85c53f732bbcf4e70b01202360a34c8
LU-10134 lfsck: not add requests if engine out of work

There is race condition between LFSCK assistant engine and
LFSCK request generators: before the LFSCK assistant engine
exit, it will mark itself as 'stopping', then cleanup the
in-queue requests, and then mark itself as 'stopped'. It is
expected that the 'stopping' status will prevent generators
adding more LFSCK requests. But current implementation only
checks 'stopped' or not. So if the LFSCK engine thread exit
before the whole system scanned that may because of some
failures or on demand, more LFSCK requests may be added in
the queue after the cleanup.

The patch fixes the wrong logic by checking 'running' or not,
and stop adding more LFSCK requests if not 'running'.

This is a port to b2_10 of
Lustre-change: https://review.whamcloud.com/#/c/30165/
Lustre-commit: 159bde49676b9a49eb3e4cb57c8c3a58a49ba0af

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ic2b5ca3f5e80b5be5a5c60aa24f0b54682b717d9
Reviewed-on: https://review.whamcloud.com/30375
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/lfsck/lfsck_engine.c
lustre/lfsck/lfsck_namespace.c