md: a few more bug fixes for 3.4
2 are tagged for -stable, one being for a fairly serious bug that can corrupt metadata and make it hard to recovery an array. The other is for a more recent regression since 3.3 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) iQIVAwUAT5X6Cznsnt1WYoG5AQIvkw/9FwdFZHr71rc1wlxGgJysC71g5JKo7Mww ZXX5C6nR2lrGHSL55RmGWNXYrzswMNp+92TX6XsyMm/JUOSZBBpShSw2yNlyuaBv 35KFaGuZzXulSQH38D6YVtEm42Gs38gia+fwnv4qPLeVafSSoQQ/o4j648hnulxR jDjzkYj9NJLb+ApxteAZvQ6iS9A6kgVahHUjTnvx605t/eZzJ9Gtm6gdJv4SZ9UA AjZet+FDaLf1N32AcAirIGICjh0zWMPdknWUwpw2CvYhnLavEi/mcw14Tv+Phy9k euUTZZ1QAqZzOc9lIaL5Z3pS4pg1PgoV7vfHxK5bZ2wvFMGsujRcEpPK6DSbLeV8 TY/6H+B3FFkE32m8+aOZMcDxs8fR6fA37sF455VV+37RLIg7gnNkJonSD1ZIVj2m 8ZLezByRyah05E5C/1ShJtnQPVbni5P5iVtIK6DQ8Lr3PsXfnMAl3L2Xb75Y6lIY /sO5An2Y0PnwKKGFaJt+wUx6h/dNGKGFFi2+iKfgiF/eml6n6+X6HbwhtR5TUxN6 KUU5m8O3u9jKY7jqosmbYtU9V00NHpc7UYd6u9UvAj+ySlTbY2z+YnfeoO8MO/CK j//LaNz9TzkVvw6UaQHMlzt8AUlXGJ2XTdolwMsB8DFgBNw3wnIB+wZW7D11I22Y tzZs41wVX5s= =8UG6 -----END PGP SIGNATURE----- Merge tag 'md-3.4-fixes' of git://neil.brown.name/md Pull a few more md bug fixes from NeilBrown: "2 are tagged for -stable, one being for a fairly serious bug that can corrupt metadata and make it hard to recovery an array. The other is for a more recent regression since 3.3" * tag 'md-3.4-fixes' of git://neil.brown.name/md: md: fix possible corruption of array metadata on shutdown. md: don't call ->add_disk unless there is good reason. DM RAID: Use safe version of rdev_for_each
This commit is contained in:
commit
d2da626d6c
|
@ -859,7 +859,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
|
|||
int ret;
|
||||
unsigned redundancy = 0;
|
||||
struct raid_dev *dev;
|
||||
struct md_rdev *rdev, *freshest;
|
||||
struct md_rdev *rdev, *tmp, *freshest;
|
||||
struct mddev *mddev = &rs->md;
|
||||
|
||||
switch (rs->raid_type->level) {
|
||||
|
@ -877,7 +877,7 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
|
|||
}
|
||||
|
||||
freshest = NULL;
|
||||
rdev_for_each(rdev, mddev) {
|
||||
rdev_for_each_safe(rdev, tmp, mddev) {
|
||||
if (!rdev->meta_bdev)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -7560,14 +7560,14 @@ void md_check_recovery(struct mddev *mddev)
|
|||
* any transients in the value of "sync_action".
|
||||
*/
|
||||
set_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
|
||||
clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
|
||||
/* Clear some bits that don't mean anything, but
|
||||
* might be left set
|
||||
*/
|
||||
clear_bit(MD_RECOVERY_INTR, &mddev->recovery);
|
||||
clear_bit(MD_RECOVERY_DONE, &mddev->recovery);
|
||||
|
||||
if (test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
|
||||
if (!test_and_clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery) ||
|
||||
test_bit(MD_RECOVERY_FROZEN, &mddev->recovery))
|
||||
goto unlock;
|
||||
/* no recovery is running.
|
||||
* remove any failed drives, then
|
||||
|
@ -8140,7 +8140,8 @@ static int md_notify_reboot(struct notifier_block *this,
|
|||
|
||||
for_each_mddev(mddev, tmp) {
|
||||
if (mddev_trylock(mddev)) {
|
||||
__md_stop_writes(mddev);
|
||||
if (mddev->pers)
|
||||
__md_stop_writes(mddev);
|
||||
mddev->safemode = 2;
|
||||
mddev_unlock(mddev);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue