Whamcloud - gitweb
LU-10321 lfsck: allow to stop the in-starting lfsck 22/30422/3
authorFan Yong <fan.yong@intel.com>
Thu, 7 Dec 2017 08:03:34 +0000 (16:03 +0800)
committerJohn L. Hammond <john.hammond@intel.com>
Fri, 2 Feb 2018 18:11:41 +0000 (18:11 +0000)
commit147b2b4177f9f8d3c4407cd74bb1b97a5c5d7f53
tree6590f2f4f548f6b2e3431a1c9b280ff188b5bba7
parent679ea6460a9f0b21d1019aea4b3017bab5f3c270
LU-10321 lfsck: allow to stop the in-starting lfsck

The LFSCK start logic will hold li_mutex on the lfsck instance
during LFSCK start processing. The LFSCK stop logic also needs
to take the li_mutex on the lfsck instance when stop the LFSCK.
If someone triggers lfsck_stop (such as when umount the target)
before the lfsck_start return, then lfsck_stop will be blocked
on the li_mutex. And if the li_mutex holder is blocked by other
things, for example, it may be waiting for the LFSCK RPC to be
handled by remote server (MDT/OST) but the connection or remote
server is not ready yet, then the lfsck_stop will be blocked.

To avoid such cascade block trouble, the patch makes lfsck_stop
can go ahead without taking li_mutex, then it can directly tell
related LFSCK engines the stop event even if former lfsck_start
does not complete yet.

This is a port to b2_10 of
Lustre-change: https://review.whamcloud.com/#/c/30420/
Lustre-commit: 7817928a62c8a212f5c2b040587042c193bd5c1a

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