diff options
author | Guoqing Jiang <gqjiang@suse.com> | 2016-05-02 15:33:14 (GMT) |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-05-04 19:39:35 (GMT) |
commit | a578183ed9dff915878ec6c2b3bf729bf72b9bd1 (patch) | |
tree | b496660323c44277d3ed8cc362148060bae287c1 /drivers/md/md.c | |
parent | ab5a98b132fd1a08ca35e95498fb45f4a8f3b0c4 (diff) | |
download | linux-a578183ed9dff915878ec6c2b3bf729bf72b9bd1.tar.xz |
md-cluster: wakeup thread if activated a spare disk
When a device is re-added, it will ultimately need
to be activated and that happens in md_check_recovery,
so we need to set MD_RECOVERY_NEEDED right after
remove_and_add_spares.
A specifical issue without the change is that when
one node perform fail/remove/readd on a disk, but
slave nodes could not add the disk back to array as
expected (added as missed instead of in sync). So
give slave nodes a chance to do resync.
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 8cc4bbc..06f6e81 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -8694,6 +8694,11 @@ static void check_sb_changes(struct mddev *mddev, struct md_rdev *rdev) ret = remove_and_add_spares(mddev, rdev2); pr_info("Activated spare: %s\n", bdevname(rdev2->bdev,b)); + /* wakeup mddev->thread here, so array could + * perform resync with the new activated disk */ + set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); + md_wakeup_thread(mddev->thread); + } /* device faulty * We just want to do the minimum to mark the disk |