Re: [PATCH 1/2] mdadm: Fix array size mismatch after grow

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

 



On Mon, 30 May 2022 18:01:05 +0800, Coly Li <colyli@xxxxxxx> wrote:

Hi Coly,
> Hi Lukasz,
> 
> 
> > 2022年4月7日 22:27,Lukasz Florczak
> > <lukasz.florczak@xxxxxxxxxxxxxxx> 写道:
> > 
> > imsm_fix_size_mismatch() is invoked to fix the problem, but it
> > couldn't proceed due to migration check. This patch allows for
> > intended behavior.
> 
> 
> Could you please explain a bit more about why “it couldn’t proceed
> due to migration”, and what is the “intended behavior”? It may help
> me to understand your change and response faster.

The intended behavior here is to fix the array size after grow that is
displayed in mdadm detail, since there can be a mismatch if the raid
was created in EFI [1]. That is the array size is not consistent with
the formula: 
Array_size * block_size = Num_stripes * Chunk_size * Num_of_data_drives 

That fix couldn't happen as the metadata update part was efficiently
omitted with continue statement after the migration type condition was
met. 

About migration I didn't go that much into detail, but it was an issue
that dev->vol.migr_type was still in MIGR_GEN_MIGR state even though
imsm_fix_size_mismatch() was called after migration has been finished,
at least from the mdadm's point of view. That happens because this
value is changed later, afaik, by mdmon. The initial idea here must've
been not to change the array size during migration, but that is not
valid since its state is just not updated yet.

[1]
https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?id=895ffd992954069e4ea67efb8a85bb0fd72c3707

Thanks,
Lukasz

> 
> Thank you in advance.
> 
> Coly Li
> 
> > 
> > Signed-off-by: Lukasz Florczak <lukasz.florczak@xxxxxxxxxxxxxxx>
> > ---
> > super-intel.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/super-intel.c b/super-intel.c
> > index d5fad102..102689bc 100644
> > --- a/super-intel.c
> > +++ b/super-intel.c
> > @@ -11757,7 +11757,7 @@ static int imsm_fix_size_mismatch(struct
> > supertype *st, int subarray_index) unsigned long long d_size =
> > imsm_dev_size(dev); int u_size;
> > 
> > -		if (calc_size == d_size || dev->vol.migr_type ==
> > MIGR_GEN_MIGR)
> > +		if (calc_size == d_size)
> > 			continue;
> > 
> > 		/* There is a difference, confirm that
> > imsm_dev_size is -- 
> > 2.27.0
> > 
> 




[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