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]

 



Hi Neil,

>> 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.

That doesn't work for containers. The "device" in the container case is
the container itself. Only by parsing the container and its subarrays
does mdadm -As succeed.

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

Well, the problem might be fixed differently by having "mdadm -Dbv" in
the container case print the container device. I am not sure if that's
what you meant.

Below is the output of mdadm -Dbv from the DDF test case. Without my
patch, it can't be assembled with -As because /dev/md/ddf0 is not in the
devices list. If the "devices=" lines are deleted from the file, it
works. It would also work if the container device was a member of the
devices list.

Note that even if the "devices=" line is missing, select_devices() will
discard all the devices listed for subarrays ("/dev/loop10 has wrong
UUID"). This is because getinfo_super() will return the UUID of the
container, not of any subarray, in line 370 of Assemble.c. But the
scanning of the container device works.

ARRAY /dev/md/ddf0 level=container num-devices=5 metadata=ddf
UUID=0cadff6e:56f14bc0:5ac6bed5:b602c0a9
   devices=/dev/loop10,/dev/loop11,/dev/loop12,/dev/loop8,/dev/loop9
ARRAY /dev/md/r0 level=raid0 num-devices=5 container=/dev/md/ddf0
member=0 UUID=6c900c64:1873e2d0:ee78718b:7f156c44
   devices=/dev/loop10,/dev/loop11,/dev/loop12,/dev/loop8,/dev/loop9
ARRAY /dev/md/r1 level=raid1 num-devices=2 container=/dev/md/ddf0
member=1 UUID=caae05ca:e07a497a:bd066562:b5164eea
   devices=/dev/loop8,/dev/loop9
ARRAY /dev/md/r5 level=raid5 num-devices=3 container=/dev/md/ddf0
member=2 UUID=29f6e6ea:16d4a6f7:1808b76e:33c50480
   devices=/dev/loop10,/dev/loop11,/dev/loop12

Regards
Martin

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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