[PATCH] md: when resizing an array, we need to update resync_max_sectors as well...
authorNeilBrown <neilb@cse.unsw.edu.au>
Wed, 27 Jul 2005 18:43:28 +0000 (11:43 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 27 Jul 2005 23:25:48 +0000 (16:25 -0700)
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>
drivers/md/raid1.c
drivers/md/raid5.c
drivers/md/raid6main.c

index 5f253ee536bb3219bf97814b891c8592ee2187a0..d3a64a04a6d857558e16b54e3794fb7830e5f2ec 100644 (file)
@@ -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;
 }
 
index 93a9726cc2d6793ed237bfa8d3f2a955da501667..4698d5f79575dd00a4bd03c355e86881654d0654 100644 (file)
@@ -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;
 }
 
index f62ea1a73d0d9d1b87f5f10d7b91a6f6d7f48b0d..f5ee16805111b9eea157c72f2a2e5b20c9ea2f47 100644 (file)
@@ -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;
 }