aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorMariusz Tkaczyk <mariusz.tkaczyk@intel.com>2018-09-04 09:08:30 -0400
committerShaohua Li <shli@fb.com>2018-09-28 14:13:15 -0400
commitfb73b357fb985cc652a72a41541d25915c7f9635 (patch)
tree34fe446e851510302425c8f69c5696934e7cfbcd /drivers/md
parentf151f57bfd97fb8c76bbef9e181ecba5dd750f2a (diff)
raid5: block failing device if raid will be failed
Currently there is an inconsistency for failing the member drives for arrays with different RAID levels. For RAID456 - there is a possibility to fail all of the devices. However - for other RAID levels - kernel blocks removing the member drive, if the operation results in array's FAIL state (EBUSY is returned). For example - removing last drive from RAID1 is not possible. This kind of blocker was never implemented for raid456 and we cannot see the reason why. We had tested following patch and did not observe any regression, so do you have any comments/reasons for current approach, or we can send the proper patch for this? Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid5.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index e4e98f47865d..4990f0319f6c 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2681,6 +2681,18 @@ static void raid5_error(struct mddev *mddev, struct md_rdev *rdev)
2681 pr_debug("raid456: error called\n"); 2681 pr_debug("raid456: error called\n");
2682 2682
2683 spin_lock_irqsave(&conf->device_lock, flags); 2683 spin_lock_irqsave(&conf->device_lock, flags);
2684
2685 if (test_bit(In_sync, &rdev->flags) &&
2686 mddev->degraded == conf->max_degraded) {
2687 /*
2688 * Don't allow to achieve failed state
2689 * Don't try to recover this device
2690 */
2691 conf->recovery_disabled = mddev->recovery_disabled;
2692 spin_unlock_irqrestore(&conf->device_lock, flags);
2693 return;
2694 }
2695
2684 set_bit(Faulty, &rdev->flags); 2696 set_bit(Faulty, &rdev->flags);
2685 clear_bit(In_sync, &rdev->flags); 2697 clear_bit(In_sync, &rdev->flags);
2686 mddev->degraded = raid5_calc_degraded(conf); 2698 mddev->degraded = raid5_calc_degraded(conf);