mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-31 05:47:43 +03:00
91bb202ded
It's possible that while a device is already referenced in sysfs, the node is not yet in /dev directory. This may happen in some rare cases right after LVs get created - we sync with udev (or alternatively we create /dev content ourselves) while VG lock is held. However, dev scan is done without VG lock so devices may already be in sysfs, but /dev may not be updated yet if we call LVM command right after LV creation (so the fact that fs_unlock is done within VG lock is not usable here much). This is not a problem with devtmpfs as there's at least kernel name for device in /dev as soon as the sysfs item exists, but we still support environments without devtmpfs or where different directory for dev nodes is used (e.g. our test suite). This patch covers these situations by tracking such devices in _cache.sysfs_only_names helper hash for the vgid/lvid check to work still. This also resolves commit 6129d2e64d14047169048775dc7081135c0fcc50 which was then reverted by commit 109b7e2095a7bc5603bf79db0224b8399463af7c due to performance issues it may have brought (...and it didn't resolve the problem fully anyway).