Commit 4b5c7ae8 authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds
Browse files

[PATCH] md: when resizing an array, we need to update resync_max_sectors 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: default avatarNeil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent b38817dd
...@@ -1468,6 +1468,7 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors) ...@@ -1468,6 +1468,7 @@ static int raid1_resize(mddev_t *mddev, sector_t sectors)
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
} }
mddev->size = mddev->array_size; mddev->size = mddev->array_size;
mddev->resync_max_sectors = sectors;
return 0; return 0;
} }
......
...@@ -1931,6 +1931,7 @@ static int raid5_resize(mddev_t *mddev, sector_t sectors) ...@@ -1931,6 +1931,7 @@ static int raid5_resize(mddev_t *mddev, sector_t sectors)
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
} }
mddev->size = sectors /2; mddev->size = sectors /2;
mddev->resync_max_sectors = sectors;
return 0; return 0;
} }
......
...@@ -2095,6 +2095,7 @@ static int raid6_resize(mddev_t *mddev, sector_t sectors) ...@@ -2095,6 +2095,7 @@ static int raid6_resize(mddev_t *mddev, sector_t sectors)
set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
} }
mddev->size = sectors /2; mddev->size = sectors /2;
mddev->resync_max_sectors = sectors;
return 0; return 0;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment