Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6751b2b authored by NeilBrown's avatar NeilBrown
Browse files

md: Don't allow slot_store while resync/recovery is happening.



Activating a spare in an array while resync/recovery is already
happening can lead the that spare being marked in-sync when it isn't
really.
So don't allow the 'slot' to be set (this activating the device)
while resync/recovery is happening.

Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 7281f812
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -2463,6 +2463,9 @@ slot_store(mdk_rdev_t *rdev, const char *buf, size_t len)
		if (rdev->raid_disk != -1)
		if (rdev->raid_disk != -1)
			return -EBUSY;
			return -EBUSY;


		if (test_bit(MD_RECOVERY_RUNNING, &rdev->mddev->recovery))
			return -EBUSY;

		if (rdev->mddev->pers->hot_add_disk == NULL)
		if (rdev->mddev->pers->hot_add_disk == NULL)
			return -EINVAL;
			return -EINVAL;