diff options
author | Guoqing Jiang <gqjiang@suse.com> | 2018-07-02 16:26:26 +0800 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2018-07-05 11:17:02 -0700 |
commit | df8c676418e1eb6f7bbafc1e01983f3538584894 (patch) | |
tree | c6fb3420bee7c86d9cb1e3973c4df611a366a856 | |
parent | 0357ba27bd611ff496390fdb172fdb31ca475398 (diff) | |
download | linux-stable-df8c676418e1eb6f7bbafc1e01983f3538584894.tar.gz linux-stable-df8c676418e1eb6f7bbafc1e01983f3538584894.tar.bz2 linux-stable-df8c676418e1eb6f7bbafc1e01983f3538584894.zip |
md-cluster: don't send msg if array is closing
If we close an array which resync thread is running,
then we don't need the node to send msg since another
node would launch the resync thread to continue the
rest works. Also send a message is time consuming,
we should avoid it.
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
-rw-r--r-- | drivers/md/md-cluster.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c index 5ed13c4fe72d..e8a74e92be30 100644 --- a/drivers/md/md-cluster.c +++ b/drivers/md/md-cluster.c @@ -1281,7 +1281,15 @@ static int resync_finish(struct mddev *mddev) clear_bit(MD_RESYNCING_REMOTE, &mddev->recovery); dlm_unlock_sync(cinfo->resync_lockres); - return resync_info_update(mddev, 0, 0); + + /* + * If resync thread is interrupted so we can't say resync is finished, + * another node will launch resync thread to continue. + */ + if (test_bit(MD_CLOSING, &mddev->flags)) + return 0; + else + return resync_info_update(mddev, 0, 0); } static int area_resyncing(struct mddev *mddev, int direction, |