public inbox for linux-raid@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] md: fix update super 1.0 on rdev size change
@ 2021-11-12 14:28 markus
  2021-11-15  9:47 ` Xiao Ni
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: markus @ 2021-11-12 14:28 UTC (permalink / raw)
  To: song, linux-raid, xni; +Cc: Markus Hochholdinger

From: Markus Hochholdinger <markus@hochholdinger.net>

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.

Fixes: commit d9c0fa509eaf ("md: fix max sectors calculation for super 1.0")
---
 drivers/md/md.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 6c0c3d0d905a..ad968cfc883d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -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);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-11-16 16:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-12 14:28 [PATCH] md: fix update super 1.0 on rdev size change markus
2021-11-15  9:47 ` Xiao Ni
2021-11-15 18:39   ` Markus Hochholdinger
2021-11-15 20:07     ` Wol
2021-11-16  8:35       ` Xiao Ni
2021-11-16  7:53     ` Xiao Ni
2021-11-16  9:28       ` Markus Hochholdinger
2021-11-16 16:41         ` Wols Lists
2021-11-16  8:36 ` Xiao Ni
2021-11-16  9:24 ` Paul Menzel
2021-11-16  9:44   ` Markus Hochholdinger
2021-11-16  9:52     ` Paul Menzel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox