diff options
author | Guoqing Jiang <gqjiang@suse.com> | 2016-08-12 01:42:43 -0400 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-09-21 12:09:44 -0400 |
commit | d6385db94196b253ae5eb3678fa95cdf1f839fcc (patch) | |
tree | 5773690f74d0ff68216247c330815df5d0820b35 | |
parent | 7bcda7149dd6911bee15a51b22477f592f8b9620 (diff) |
md-cluster: make resync lock also could be interruptted
When one node is perform resync or recovery, other nodes
can't get resync lock and could block for a while before
it holds the lock, so we can't stop array immediately for
this scenario.
To make array could be stop quickly, we check MD_CLOSING
in dlm_lock_sync_interruptible to make us can interrupt
the lock request.
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
-rw-r--r-- | drivers/md/md-cluster.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c index 43b90485448d..2b13117fb918 100644 --- a/drivers/md/md-cluster.c +++ b/drivers/md/md-cluster.c | |||
@@ -161,7 +161,8 @@ static int dlm_lock_sync_interruptible(struct dlm_lock_resource *res, int mode, | |||
161 | return ret; | 161 | return ret; |
162 | 162 | ||
163 | wait_event(res->sync_locking, res->sync_locking_done | 163 | wait_event(res->sync_locking, res->sync_locking_done |
164 | || kthread_should_stop()); | 164 | || kthread_should_stop() |
165 | || test_bit(MD_CLOSING, &mddev->flags)); | ||
165 | if (!res->sync_locking_done) { | 166 | if (!res->sync_locking_done) { |
166 | /* | 167 | /* |
167 | * the convert queue contains the lock request when request is | 168 | * the convert queue contains the lock request when request is |
@@ -1045,7 +1046,7 @@ static void metadata_update_cancel(struct mddev *mddev) | |||
1045 | static int resync_start(struct mddev *mddev) | 1046 | static int resync_start(struct mddev *mddev) |
1046 | { | 1047 | { |
1047 | struct md_cluster_info *cinfo = mddev->cluster_info; | 1048 | struct md_cluster_info *cinfo = mddev->cluster_info; |
1048 | return dlm_lock_sync(cinfo->resync_lockres, DLM_LOCK_EX); | 1049 | return dlm_lock_sync_interruptible(cinfo->resync_lockres, DLM_LOCK_EX, mddev); |
1049 | } | 1050 | } |
1050 | 1051 | ||
1051 | static int resync_info_update(struct mddev *mddev, sector_t lo, sector_t hi) | 1052 | static int resync_info_update(struct mddev *mddev, sector_t lo, sector_t hi) |