Re: [PATCH 1/2] select_devices: fix scanning of container members with dev list

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

 



On Thu, 20 Jun 2013 22:21:04 +0200 mwilck@xxxxxxxx wrote:

> commit b3908491 "Detail: fix --brief --verbose" introduced a
> problem when a mdadm.conf file generated with
> "mdadm --Detail --brief --verbose" is later scanned with
> "mdadm --Assemble --scan --config=mdadm.conf"
> 
> mdadm -Dbv will print a "devices" list now, but because the
> container device is not in that list, it won't be considered
> for assembly.
> 
> This patch fixes that by moving the test for member devices
> further down, after the check for a container.
> 
> Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>

Hi Martin,
 I really don't like this.  If there is a "device=" entry then it should not
 even open anything not listed.

 Can you give me more details about the problem you are experiencing?  Maybe
 the problem is in "mdadm -Dbv".

Thanks,
NeilBrown

> ---
>  Assemble.c |   15 ++++++++-------
>  1 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/Assemble.c b/Assemble.c
> index c927c20..1f023e8 100644
> --- a/Assemble.c
> +++ b/Assemble.c
> @@ -170,13 +170,6 @@ static int select_devices(struct mddev_dev *devlist,
>  		if (tmpdev->used > 1)
>  			continue;
>  
> -		if (ident->devices &&
> -		    !match_oneof(ident->devices, devname)) {
> -			if (report_mismatch)
> -				pr_err("%s is not one of %s\n", devname, ident->devices);
> -			continue;
> -		}
> -
>  		tst = dup_super(st);
>  
>  		dfd = dev_open(devname, O_RDONLY);
> @@ -365,6 +358,14 @@ static int select_devices(struct mddev_dev *devlist,
>  			int rv = 0;
>  			struct mddev_ident *match;
>  
> +			if (ident->devices &&
> +			    !match_oneof(ident->devices, devname)) {
> +				if (report_mismatch)
> +					pr_err("%s is not one of %s\n", devname,
> +					       ident->devices);
> +				goto loop;
> +			}
> +
>  			content = *contentp;
>  			tst->ss->getinfo_super(tst, content, NULL);
>  

Attachment: signature.asc
Description: PGP signature


[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