aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid.c
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2016-11-29 16:37:30 -0500
committerMike Snitzer <snitzer@redhat.com>2016-12-08 14:13:12 -0500
commit11e2968478edc07a75ee1efb45011b3033c621c2 (patch)
treec8b204186efd6e7e1f12dd85d9aaa2d29f6428ca /drivers/md/dm-raid.c
parentaffa9d28f7e9a802c8f497ed54fe79a5689d95e9 (diff)
dm raid: fix discard support regression
Commit ecbfb9f118 ("dm raid: add raid level takeover support") moved the configure_discard_support() call from raid_ctr() to raid_preresume(). Enabling/disabling discard _must_ happen during table load (through the .ctr hook). Fix this regression by moving the configure_discard_support() call back to raid_ctr(). Fixes: ecbfb9f118 ("dm raid: add raid level takeover support") Cc: stable@vger.kernel.org # 4.8+ 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.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 9d5c6bb9e35b..b49b12242651 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -2999,6 +2999,9 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv)
2999 } 2999 }
3000 } 3000 }
3001 3001
3002 /* Disable/enable discard support on raid set. */
3003 configure_discard_support(rs);
3004
3002 mddev_unlock(&rs->md); 3005 mddev_unlock(&rs->md);
3003 return 0; 3006 return 0;
3004 3007
@@ -3585,12 +3588,6 @@ static int raid_preresume(struct dm_target *ti)
3585 if (test_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags)) 3588 if (test_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags))
3586 rs_update_sbs(rs); 3589 rs_update_sbs(rs);
3587 3590
3588 /*
3589 * Disable/enable discard support on raid set after any
3590 * conversion, because devices can have been added
3591 */
3592 configure_discard_support(rs);
3593
3594 /* Load the bitmap from disk unless raid0 */ 3591 /* Load the bitmap from disk unless raid0 */
3595 r = __load_dirty_region_bitmap(rs); 3592 r = __load_dirty_region_bitmap(rs);
3596 if (r) 3593 if (r)