Commit 31e10a41 authored by Heinz Mauelshagen's avatar Heinz Mauelshagen Committed by Mike Snitzer

dm raid: fix restoring of failed devices regression

'lvchange --refresh RaidLV' causes a mapped device suspend/resume cycle
aiming at device restore and resync after transient device failures.  This
failed because flag RT_FLAG_RS_RESUMED was always cleared in the suspend path,
thus the device restore wasn't performed in the resume path.

Solve by removing RT_FLAG_RS_RESUMED from the suspend path and resume
unconditionally.  Also, remove superfluous comment from raid_resume().
Signed-off-by: default avatarHeinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent a4423287
...@@ -3382,11 +3382,10 @@ static void raid_postsuspend(struct dm_target *ti) ...@@ -3382,11 +3382,10 @@ static void raid_postsuspend(struct dm_target *ti)
{ {
struct raid_set *rs = ti->private; struct raid_set *rs = ti->private;
if (test_and_clear_bit(RT_FLAG_RS_RESUMED, &rs->runtime_flags)) {
if (!rs->md.suspended) if (!rs->md.suspended)
mddev_suspend(&rs->md); mddev_suspend(&rs->md);
rs->md.ro = 1; rs->md.ro = 1;
}
} }
static void attempt_restore_of_faulty_devices(struct raid_set *rs) static void attempt_restore_of_faulty_devices(struct raid_set *rs)
...@@ -3606,25 +3605,15 @@ static void raid_resume(struct dm_target *ti) ...@@ -3606,25 +3605,15 @@ static void raid_resume(struct dm_target *ti)
* devices are reachable again. * devices are reachable again.
*/ */
attempt_restore_of_faulty_devices(rs); attempt_restore_of_faulty_devices(rs);
} else { }
mddev->ro = 0; mddev->ro = 0;
mddev->in_sync = 0; mddev->in_sync = 0;
/*
* When passing in flags to the ctr, we expect userspace
* to reset them because they made it to the superblocks
* and reload the mapping anyway.
*
* -> only unfreeze recovery in case of a table reload or
* we'll have a bogus recovery/reshape position
* retrieved from the superblock by the ctr because
* the ongoing recovery/reshape will change it after read.
*/
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery); clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
if (mddev->suspended) if (mddev->suspended)
mddev_resume(mddev); mddev_resume(mddev);
}
} }
static struct target_type raid_target = { static struct target_type raid_target = {
......
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