* [PATCH v2] md: fix update super 1.0 on rdev size change
@ 2021-11-16 10:21 Markus Hochholdinger
2021-11-17 7:17 ` Song Liu
0 siblings, 1 reply; 3+ messages in thread
From: Markus Hochholdinger @ 2021-11-16 10:21 UTC (permalink / raw)
To: song, linux-raid, xni, pmenzel; +Cc: 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 <markus@hochholdinger.net>
Reviewd-by: Xiao Ni <xni@redhat.com>
---
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] 3+ messages in thread
* Re: [PATCH v2] md: fix update super 1.0 on rdev size change
2021-11-16 10:21 [PATCH v2] md: fix update super 1.0 on rdev size change Markus Hochholdinger
@ 2021-11-17 7:17 ` Song Liu
2021-11-17 10:20 ` Markus Hochholdinger
0 siblings, 1 reply; 3+ messages in thread
From: Song Liu @ 2021-11-17 7:17 UTC (permalink / raw)
To: Markus Hochholdinger; +Cc: linux-raid, Xiao Ni, Paul Menzel
On Tue, Nov 16, 2021 at 2:22 AM Markus Hochholdinger
<markus@hochholdinger.net> wrote:
>
> 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 <markus@hochholdinger.net>
> Reviewd-by: Xiao Ni <xni@redhat.com>
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] md: fix update super 1.0 on rdev size change
2021-11-17 7:17 ` Song Liu
@ 2021-11-17 10:20 ` Markus Hochholdinger
0 siblings, 0 replies; 3+ messages in thread
From: Markus Hochholdinger @ 2021-11-17 10:20 UTC (permalink / raw)
To: Song Liu; +Cc: linux-raid, Xiao Ni, Paul Menzel
Am Mittwoch, 17. November 2021, 08:17:21 CET schrieb Song Liu:
> On Tue, Nov 16, 2021 at 2:22 AM Markus Hochholdinger
> <markus@hochholdinger.net> wrote:
> > 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 <markus@hochholdinger.net>
> > Reviewd-by: Xiao Ni <xni@redhat.com>
> Applied to md-fixes. Thanks!
Many 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.
OK, I wasn't aware of that, will do that check the next time.
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-11-17 10:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16 10:21 [PATCH v2] md: fix update super 1.0 on rdev size change Markus Hochholdinger
2021-11-17 7:17 ` Song Liu
2021-11-17 10:20 ` Markus Hochholdinger
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.