Re: [PATCH] md: fix update super 1.0 on rdev size change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Markus

The sb_start doesn't change in function super_1_rdev_size_change. For super1.0
the super start is always at a fixed position. Is there a possibility
the disk size
changes? sb_start is calculated based on i_size_read(rdev->bdev->bd_inode).

By the way, can you reproduce this problem? If so, could you share
your test steps?

Regards
Xiao

On Fri, Nov 12, 2021 at 10:29 PM <markus@xxxxxxxxxxxxxxxxx> wrote:
>
> From: Markus Hochholdinger <markus@xxxxxxxxxxxxxxxxx>
>
> 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
>




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux