Skip to content

Commit

Permalink
dm raid: fix discard support regression
Browse files Browse the repository at this point in the history
Commit ecbfb9f ("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: ecbfb9f ("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>
  • Loading branch information
Heinz Mauelshagen authored and Mike Snitzer committed Dec 8, 2016
1 parent affa9d2 commit 11e2968
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/md/dm-raid.c
Original file line number Diff line number Diff line change
@@ -2999,6 +2999,9 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv)
}
}

/* Disable/enable discard support on raid set. */
configure_discard_support(rs);

mddev_unlock(&rs->md);
return 0;

@@ -3585,12 +3588,6 @@ static int raid_preresume(struct dm_target *ti)
if (test_bit(RT_FLAG_UPDATE_SBS, &rs->runtime_flags))
rs_update_sbs(rs);

/*
* Disable/enable discard support on raid set after any
* conversion, because devices can have been added
*/
configure_discard_support(rs);

/* Load the bitmap from disk unless raid0 */
r = __load_dirty_region_bitmap(rs);
if (r)

0 comments on commit 11e2968

Please sign in to comment.