Skip to content

Commit

Permalink
[PATCH] md: when resizing an array, we need to update resync_max_sect…
Browse files Browse the repository at this point in the history
…ors as well as size

Without this, and attempt to 'grow' an array will claim to have synced the
extra part without actually having done anything.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Jul 27, 2005
1 parent b38817d commit 4b5c7ae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/md/raid1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,7 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors)
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
}
mddev->size = mddev->array_size;
mddev->resync_max_sectors = sectors;
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,7 @@ static int raid5_resize(mddev_t *mddev, sector_t sectors)
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
}
mddev->size = sectors /2;
mddev->resync_max_sectors = sectors;
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/md/raid6main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2095,6 +2095,7 @@ static int raid6_resize(mddev_t *mddev, sector_t sectors)
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
}
mddev->size = sectors /2;
mddev->resync_max_sectors = sectors;
return 0;
}

Expand Down

0 comments on commit 4b5c7ae

Please sign in to comment.