Skip to content

Commit

Permalink
[PATCH] md: make sure raid5/raid6 resync uses correct 'max_sectors'
Browse files Browse the repository at this point in the history
The default resync_max_sector is set to "mddev->size << 1".  If the
raid-personality-module updates mddev->size, it must update
resync_max_sectors too.

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 Aug 2, 2005
1 parent 57ee67a commit b158156
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,7 @@ static int run (mddev_t *mddev)

/* device size must be a multiple of chunk size */
mddev->size &= ~(mddev->chunk_size/1024 -1);
mddev->resync_max_sectors = mddev->size << 1;

if (!conf->chunk_size || conf->chunk_size % 4) {
printk(KERN_ERR "raid5: invalid chunk size %d for %s\n",
Expand Down
1 change: 1 addition & 0 deletions drivers/md/raid6main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,7 @@ static int run (mddev_t *mddev)

/* device size must be a multiple of chunk size */
mddev->size &= ~(mddev->chunk_size/1024 -1);
mddev->resync_max_sectors = mddev->size << 1;

if (conf->raid_disks < 4) {
printk(KERN_ERR "raid6: not enough configured devices for %s (%d, minimum 4)\n",
Expand Down

0 comments on commit b158156

Please sign in to comment.