Skip to content

Commit

Permalink
dm raid: make rs_set_capacity to work on shrinking reshape
Browse files Browse the repository at this point in the history
Signed-off-by: Heinz Mauelshagen <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
  • Loading branch information
mauelsha authored and snitm committed Jul 18, 2016
1 parent 6ee0bae commit 9d9d939
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/md/dm-raid.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,7 @@ static void rs_set_capacity(struct raid_set *rs)
{
struct mddev *mddev = &rs->md;

/* Make sure we access most actual mddev properties */
smp_rmb();
if (rs->ti->len != mddev->array_sectors && !rs_is_reshaping(rs)) {
if (rs->ti->len != mddev->array_sectors) {
struct gendisk *gendisk = dm_disk(dm_table_get_md(rs->ti->table));

set_capacity(gendisk, mddev->array_sectors);
Expand Down Expand Up @@ -1471,7 +1469,9 @@ static void do_table_event(struct work_struct *ws)
{
struct raid_set *rs = container_of(ws, struct raid_set, md.event_work);

rs_set_capacity(rs);
smp_rmb(); /* Make sure we access most actual mddev properties */
if (!rs_is_reshaping(rs))
rs_set_capacity(rs);
dm_table_event(rs->ti->table);
}

Expand Down

0 comments on commit 9d9d939

Please sign in to comment.