aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid.c
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2016-08-09 08:56:14 -0400
committerMike Snitzer <snitzer@redhat.com>2016-08-16 16:18:19 -0400
commita4423287ec16e74c25de8ee3f261b1ea18c0af67 (patch)
treedb151c6b7d4f980d1376f4adde0a5eed6613b8bc /drivers/md/dm-raid.c
parent0a83df6c8cacafbefc5b56b2fbcb92b0d75b744b (diff)
dm raid: fix frozen recovery regression
On LVM2 conversions via lvconvert(8), the target keeps mapped devices in frozen state when requesting RAID devices be resynchronized. This applies to e.g. adding legs to a raid1 device or taking over from raid0 to raid4 when the rebuild flag's set on the new raid1 legs or the added dedicated parity stripe. Also, fix frozen recovery for reshaping as well. Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-raid.c')
-rw-r--r--drivers/md/dm-raid.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 1b9795d75ef8..07d17287fa4a 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -191,7 +191,6 @@ struct raid_dev {
191#define RT_FLAG_RS_BITMAP_LOADED 2 191#define RT_FLAG_RS_BITMAP_LOADED 2
192#define RT_FLAG_UPDATE_SBS 3 192#define RT_FLAG_UPDATE_SBS 3
193#define RT_FLAG_RESHAPE_RS 4 193#define RT_FLAG_RESHAPE_RS 4
194#define RT_FLAG_KEEP_RS_FROZEN 5
195 194
196/* Array elements of 64 bit needed for rebuild/failed disk bits */ 195/* Array elements of 64 bit needed for rebuild/failed disk bits */
197#define DISKS_ARRAY_ELEMS ((MAX_RAID_DEVICES + (sizeof(uint64_t) * 8 - 1)) / sizeof(uint64_t) / 8) 196#define DISKS_ARRAY_ELEMS ((MAX_RAID_DEVICES + (sizeof(uint64_t) * 8 - 1)) / sizeof(uint64_t) / 8)
@@ -2579,7 +2578,6 @@ static int rs_prepare_reshape(struct raid_set *rs)
2579 } else { 2578 } else {
2580 /* Process raid1 without delta_disks */ 2579 /* Process raid1 without delta_disks */
2581 mddev->raid_disks = rs->raid_disks; 2580 mddev->raid_disks = rs->raid_disks;
2582 set_bit(RT_FLAG_KEEP_RS_FROZEN, &rs->runtime_flags);
2583 reshape = false; 2581 reshape = false;
2584 } 2582 }
2585 } else { 2583 } else {
@@ -2590,7 +2588,6 @@ static int rs_prepare_reshape(struct raid_set *rs)
2590 if (reshape) { 2588 if (reshape) {
2591 set_bit(RT_FLAG_RESHAPE_RS, &rs->runtime_flags); 2589 set_bit(RT_FLAG_RESHAPE_RS, &rs->runtime_flags);
2592 set_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags); 2590 set_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags);
2593 set_bit(RT_FLAG_KEEP_RS_FROZEN, &rs->runtime_flags);
2594 } else if (mddev->raid_disks < rs->raid_disks) 2591 } else if (mddev->raid_disks < rs->raid_disks)
2595 /* Create new superblocks and bitmaps, if any new disks */ 2592 /* Create new superblocks and bitmaps, if any new disks */
2596 set_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags); 2593 set_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags);
@@ -2902,7 +2899,6 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv)
2902 goto bad; 2899 goto bad;
2903 2900
2904 set_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags); 2901 set_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags);
2905 set_bit(RT_FLAG_KEEP_RS_FROZEN, &rs->runtime_flags);
2906 /* Takeover ain't recovery, so disable recovery */ 2902 /* Takeover ain't recovery, so disable recovery */
2907 rs_setup_recovery(rs, MaxSector); 2903 rs_setup_recovery(rs, MaxSector);
2908 rs_set_new(rs); 2904 rs_set_new(rs);
@@ -3624,8 +3620,7 @@ static void raid_resume(struct dm_target *ti)
3624 * retrieved from the superblock by the ctr because 3620 * retrieved from the superblock by the ctr because
3625 * the ongoing recovery/reshape will change it after read. 3621 * the ongoing recovery/reshape will change it after read.
3626 */ 3622 */
3627 if (!test_bit(RT_FLAG_KEEP_RS_FROZEN, &rs->runtime_flags)) 3623 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
3628 clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
3629 3624
3630 if (mddev->suspended) 3625 if (mddev->suspended)
3631 mddev_resume(mddev); 3626 mddev_resume(mddev);