md: fix update super 1.0 on rdev size change
PATCH v2 1/1 md: fix update super 1.0 on rdev size change
The superblock of version 1.0 doesn't get moved to the new position on a device size change. This leads to a rdev without a superblock on a known position, the raid can't be re-assembled.
The line was removed by mistake and is re-added by this patch.
--- drivers/md/md.c | 1 + 1 file changed, 1 insertion(+)
drivers/md/md.c +1 -0
@@ -2193,6 +2193,7 @@ super_1_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors)if (!num_sectors || num_sectors > max_sectors) num_sectors = max_sectors; + rdev->sb_start = sb_start; } sb =page_address (rdev->sb_page); sb->data_size =cpu_to_le64 (num_sectors);
Signature · 1 line
2.30.2
Quoted 11 lines · Markus Hochholdinger
The superblock of version 1.0 doesn't get moved to the new position on a device size change. This leads to a rdev without a superblock on a known position, the raid can't be re-assembled.
The line was removed by mistake and is re-added by this patch.
Fixes d9c0fa509eaf ("md: fix max sectors calculation for super 1.0")Signed-off-by Markus Hochholdinger <[email protected]>Reviewd-by Xiao Ni <[email protected]>
Applied to md-fixes. Thanks!
This version still has some minor issues. I fixed them before applying. For future patches, please run ./scripts/checkpatch.pl on the .patch file.
Song
Am Mittwoch, 17. November 2021, 08:17:21 CET schrieb Song Liu:
Quoted 10 lines
Quoted 7 lines · Markus Hochholdinger
The superblock of version 1.0 doesn't get moved to the new position on a device size change. This leads to a rdev without a superblock on a known position, the raid can't be re-assembled.
The line was removed by mistake and is re-added by this patch.Fixes d9c0fa509eaf ("md: fix max sectors calculation for super 1.0")Signed-off-by Markus Hochholdinger <[email protected]>Reviewd-by Xiao Ni <[email protected]>Applied to md-fixes. Thanks!
Many thanks.
Quoted 2 lines
This version still has some minor issues. I fixed them before applying. For future patches, please run
./scripts/checkpatch.plon the .patch file.
OK, I wasn't aware of that, will do that check the next time.
Regards,
Markus