Skip to contentSkip to conversation

md: fix update super 1.0 on rdev size change

PATCH Applied Markus Hochholdinger 2 participants 3 messages Nov 16, 2021 – Nov 17, 2021 MD RAID

lore
Share & tools
lore
#0 lore raw

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.

Fixes d9c0fa509eaf ("md: fix max sectors calculation for super 1.0")
---
 drivers/md/md.c | 1 +
 1 file changed, 1 insertion(+)
drivers/md/md.c +1 -0
index 6c0c3d0d905a..ad968cfc883d 100644
@@ -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
maintainer Applied
#1 lore raw
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")

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

#2 lore raw

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")

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.pl on the .patch file.

OK, I wasn't aware of that, will do that check the next time.

Regards,
Markus