Re: [PATCH] mdadm: fix --grow with --add for linear

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

 



On Sun, 26 Jan 2025 16:22:58 +0800
Yu Kuai <yukuai1@xxxxxxxxxxxxxxx> wrote:

> 在 2024/12/31 16:49, Mariusz Tkaczyk 写道:
> > On Fri, 27 Dec 2024 14:07:02 +0800
> > Yu Kuai <yukuai1@xxxxxxxxxxxxxxx> wrote:
> >   
> >> From: Yu Kuai <yukuai3@xxxxxxxxxx>
> >>
> >> For the case mdadm --grow with --add, the s.btype should not be
> >> initialized yet, hence BitmapUnknown should be checked instead of
> >> BitmapNone.  
> > 
> > Hi Kuai,
> > 
> > For commit extra clarity it would be nice to include command you are
> > executing.
> > 
> > What if someone will do (not tested):
> > #mdadm --grow /dev/md0 --add /dev/sdx --bitmap=none
> > 
> > I think that it is perfectly valid, now it may work but I expect
> > your change to broke it.  
> 
> Hi,
> 
> Sorry for the late reply, I forgot about this patch somehow :(
> 
> Changes from commit 581ba1341017:
> 
> @@ -1634,7 +1625,7 @@ int main(int argc, char *argv[])
>                  if (devs_found > 1 && s.raiddisks == 0 && s.level == 
> UnSet) {
>                          /* must be '-a'. */
>                          if (s.size > 0 || s.chunk ||
> -                           s.layout_str || s.bitmap_file) {
> +                           s.layout_str || s.btype != BitmapNone) {
>                                  pr_err("--add cannot be used with
> other geometry changes in --grow mode\n");
>                                  rv = 1;
>                                  break;
> 
> 
> Hence before the commit, bitmap=none is not valid in this case as
> well, because s.bitmap_file will set to "none" in this case.
> 
> Thanks,
> Kuai
> 

OK, ack from my side then.
If there will be no more comments we can merge it. I opened
PR to test it:
https://github.com/md-raid-utilities/mdadm/pull/145

Thanks,
Mariusz





[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