Commit b9dca3d3 authored by Neil Brown's avatar Neil Brown Committed by Greg Kroah-Hartman

MD: Fix problem where hot-added drives are not resynced.

If a drive is added with HOT_ADD_DISK rather than ADD_NEW_DISK,
saved_raid_disk isn't initialised properly, and the drive can be
included in the array without a resync.


From: Neil Brown <neilb@suse.de>
Cc: <syrius.ml@no-log.org>
Cc: Richard Bollinger <rabollinger@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 92a86ee1
...@@ -3867,6 +3867,7 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev) ...@@ -3867,6 +3867,7 @@ static int hot_add_disk(mddev_t * mddev, dev_t dev)
} }
clear_bit(In_sync, &rdev->flags); clear_bit(In_sync, &rdev->flags);
rdev->desc_nr = -1; rdev->desc_nr = -1;
rdev->saved_raid_disk = -1;
err = bind_rdev_to_array(rdev, mddev); err = bind_rdev_to_array(rdev, mddev);
if (err) if (err)
goto abort_export; goto abort_export;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment