Bug 199273 - /dev/mpath/<vgname>-<lvname> entries generated for linear targets
/dev/mpath/<vgname>-<lvname> entries generated for linear targets
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: device-mapper-multipath (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
Depends On:
  Show dependency treegraph
Reported: 2006-07-18 12:02 EDT by Mike Snitzer
Modified: 2010-01-11 21:26 EST (History)
9 users (show)

See Also:
Fixed In Version: 0.4.5-16.1.RHEL4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-08-03 14:20:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mike Snitzer 2006-07-18 12:02:07 EDT
Description of problem:
On RHEL4U3, /dev/mpath/<vgname>-<lvname> symlinks are generated that point to
the same /dev/dm-* entry that the original /dev/mapper/<vgname>-<lvname> entries
do.  These seemingly benign symlinks create yet another special case for users
to filter out/ignore.  This /dev/mpath/... symlink generation is managed by the
device-mapper-multipath's udev /etc/udev/rules.d/40-multipath.rules rule for
linear DM targets; KERNEL="dm-[0-9]*", PROGRAM="dmsetup info -c --noheadings -j
%M -m %m | grep -q .*:.*:.*:.*:.*:.*:.*:part[0-9]*-mpath-",
PROGRAM="/sbin/dmsetup ls --target linear --exec basename -j %M -m %m",
RESULT="?*", NAME="%k", SYMLINK="mpath/%c"

The question is how does this udev rule even cause udev to generate /dev/mpath
symlinks for linear DM entries that do NOT contain a UUID with: 'part[0-9]*-mpath-'?

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. dmsetup ls ... | grep -q .*:.*:.*:.*:.*:.*:.*:part[0-9]*-mpath- doesn't yield
a return status of 0
2. simply activate and deactivate a linear LV 
3. the associated /dev/mpath/ entry will be created/removed
Actual results:
# ls -al /dev/dm-0
brw-r-----  1 root root 253, 0 Jul 18 11:05 /dev/dm-0
# dmsetup info -c --noheadings -j 253 -m 3

# ls -al /dev/mpath/ivg21-ilv21
lrwxrwxrwx  1 root root 7 Jul 18 10:51 /dev/mpath/ivg21-ilv21 -> ../dm-0
# lvchange -an ivg21/ilv21
# ls -al /dev/mpath/ivg21-ilv21
ls: /dev/mpath/ivg21-ilv21: No such file or directory
# lvchange -ay ivg21/ilv21
# ls -al /dev/mpath/ivg21-ilv21
lrwxrwxrwx  1 root root 7 Jul 18 10:55 /dev/mpath/ivg21-ilv21 -> ../dm-0

Expected results:
One wouldn't expect Linear DM mappings to have mpath symlinks created simply
because the device-mapper-multipath rpm is installed.  Is there a udev bug
lurking here?  Why does this udev rule actually generate a symlink at all?

Additional info:
Comment 1 Mike Snitzer 2006-07-18 12:10:47 EDT
FYI, here are the udev log entries in /var/log/messages that result when doing
lvchange -an .... then lvchange -ay ... :

Jul 18 12:16:22 lab14-248 udev[9731]: removing device node '/dev/dm-0'
Jul 18 12:16:28 lab14-248 udev[9752]: configured rule in
'/etc/udev/rules.d/40-multipath.rules' at line 4 applied, added symlink 'mpath/%c'
Jul 18 12:16:28 lab14-248 udev[9752]: configured rule in
'/etc/udev/rules.d/40-multipath.rules' at line 4 applied, 'dm-0' becomes '%k'
Jul 18 12:16:28 lab14-248 udev[9752]: creating device node '/dev/dm-0'
Comment 2 Ben Marzinski 2006-08-03 14:20:58 EDT
This is already fixed in device-mapper-multipath-0.4.5-16.1.RHEL4

Note You need to log in before you can comment on or make changes to this bug.