1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
lvm2/lib/filters
Peter Rajnoha 9738a02d3d filter-mpath: fix primary device lookup failure for partition when processing mpath filter
If using persistent filter and we're refreshing filters (just like we
do for pvcreate now after commit 54685c20fc),
we can't rely on getting the primary device of the partition from the cache
as such device could be already filtered by persistent filter and we get
a device cache lookup failure for such device.

For example:

$ lvm dumpconfig --type diff
devices {
	obtain_device_list_from_udev=0
}

$lsblk /dev/sda
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  128M  0 disk
`-sda1   8:1    0  127M  0 part

$cat /etc/lvm/cache/.cache | grep sda
		"/dev/sda1",

$pvcreate /dev/sda1
  dev_is_mpath: failed to get device for 8:1
  Physical volume "/dev/sda1" successfully created

The problematic part of the code called dev_cache_get_by_devt
to get the device for the device number supplied. Then the code
used dev_name(dev) to get the name which is then used in check
whether there's any mpath on top of this dev...

This patch uses sysfs to get the base name for the partition
instead, hence avoiding the device cache which is a correct
approach here.
2014-08-08 10:49:19 +02:00
..
filter-composite.c filters: check for mpath before opening devs 2013-08-13 23:26:58 +01:00
filter-md.c gcc: replace #ifdef linux with __linux__ 2013-11-13 13:56:29 +00:00
filter-mpath.c filter-mpath: fix primary device lookup failure for partition when processing mpath filter 2014-08-08 10:49:19 +02:00
filter-partitioned.c filters: check for mpath before opening devs 2013-08-13 23:26:58 +01:00
filter-persistent.c report: select: refactor: move str_list to libdm 2014-06-17 16:27:20 +02:00
filter-regex.c report: select: refactor: move str_list to libdm 2014-06-17 16:27:20 +02:00
filter-sysfs.c filters: drop extra slash from sysfs path 2013-11-22 20:53:31 +01:00
filter-type.c filters: check for mpath before opening devs 2013-08-13 23:26:58 +01:00
filter.h filters: check for mpath before opening devs 2013-08-13 23:26:58 +01:00