mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-11 20:58:50 +03:00
pvcreate code path executes signature wiping if there are any signatures found on device to prepare the device for PV. When the signature is wiped, the WATCH udev rule triggers the event which then updates udev database with fresh info, clearing the old record about previous signature. However, when we're using udev db as dev-ext source, we'd need to wait for this WATCH-triggered event. But we can't synchronize against such events (at least not at this moment). Without this sync, if the code continues, the device could still be marked as containing the old signature if reading udev db. This may end up even with the device to be still filtered, though the signature is already wiped. This problem is then exposed as (an example with md components): $ mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda /dev/sdb --run $ mdadm -S /dev/md0 $ pvcreate -y /dev/sda Wiping linux_raid_member signature on /dev/sda. /dev/sda: Couldn't find device. Check your filters? $ echo $? 5 So we need to temporarily switch off "udev" dev-ext source here in this part of pvcreate code until we find a way how to sync with WATCH events. (This problem does not occur with signature wiping which we do on newly created LVs since we already handle this properly with our udev flags - the LV_NOSCAN/LV_TEMPORARY flag. But we can't use this technique for non-dm devices to keep WATCH rule under control.)