Message ID | aa820c596c7bae878e5f860249d498eff6c0658a.1522165597.git.joseph.salisbury@canonical.com |
---|---|
State | New |
Headers | show |
Series | Fixes for LP:1759279 | expand |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 4e4dee0..926542f 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -8554,6 +8554,10 @@ static int remove_and_add_spares(struct mddev *mddev, int removed = 0; bool remove_some = false; + if (this && test_bit(MD_RECOVERY_RUNNING, &mddev->recovery)) + /* Mustn't remove devices when resync thread is running */ + return 0; + rdev_for_each(rdev, mddev) { if ((this == NULL || rdev == this) && rdev->raid_disk >= 0 &&