Whamcloud - gitweb
LU-10321 lfsck: allow to stop the in-starting lfsck 20/30420/1
authorFan Yong <fan.yong@intel.com>
Thu, 7 Dec 2017 07:36:47 +0000 (15:36 +0800)
committerFan Yong <fan.yong@intel.com>
Thu, 7 Dec 2017 07:57:44 +0000 (15:57 +0800)
commit7817928a62c8a212f5c2b040587042c193bd5c1a
tree77cd2aac6720096881ed5aa422011b4f3263cc4e
parent6ec4b7d3fb7351f699569e1a8f5ad2cfa7c78df9
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.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I6e168d955db33d74778142235a8ed2802d3577d9
lustre/lfsck/lfsck_engine.c
lustre/lfsck/lfsck_lib.c