+++ This bug was initially created as a clone of Bug #518575 +++ Description of problem: Multipath UID/GID/MODE settings are not always taking effect. This appears to be a race between udevd and multipathd. A RHEL5 fix is available, see BZ 518575, but that fix is not readily back-portable to RHEL4. Other info : Event posted on 10-26-2009 07:22pm EST by mgoodwin Hi Ryan, I was working on the RHEL4 back-port today. Well, it can hardly be called a "back-port" since it's completely different, though the root cause is probably the same. I concentrated on eliminating "dmsetup ls ..." from the udev exec path since this is causing all the problems on RHEL5. This boiled down to hacking the RHEL4 scripts /sbin/{mpath_get_name,kpartx_get_name} My current patch is : --- /sbin/mpath_get_name.orig 2009-10-26 03:49:11.000000000 +1100 +++ /sbin/mpath_get_name 2009-10-26 06:49:56.000000000 +1100 @@ -19,7 +19,8 @@ if [ $ret -ne 0 ] ; then exit 1 fi -i=`/sbin/dmsetup ls --target multipath --exec basename -j $1 -m $2 2> /dev/null` +# i=`/sbin/dmsetup ls --target multipath --exec basename -j $1 -m $2 2> /dev/null` +i=`dmsetup info -c --noheadings -o name -j $1 -m $2 2>/dev/null` ... but the problem is still reproducible. More tomorrow .. Cheers -- Mark Goodwin This event sent from IssueTracker by mgoodwin issue 304239
Event posted on 12-16-2009 04:33pm EST by mgoodwin Hi Ryan, I have a fix for this now on RHEL4 - the reproducer script no longer triggers. In addition to changing /sbin/mpath_get_name and /sbin/kpartx_get_name, I also had to change /etc/dev.d/block/multipath.dev because it also calls dmsetup ls --exec, which is what's causing the race condition with multipath. No changes were needed to 40-multipath.rules (since on RHEL4, those rules just invoke mpath_get_name and kpartx_get_name). I'll attach the systemtap script and the patch to the BZ. I'll also attach the pre-patched versions of the above named programs to this ticket for you to test with the customer. Cheers -- Mark Goodwin Internal Status set to 'Waiting on Support' This event sent from IssueTracker by mgoodwin issue 358047 it_file 282211
Created attachment 378691 [details] patch against device-mapper-multipath-0.4.5-37.el4 for RHEL4 only Patch to avoid running "dmsetup ls --exec someprogram" and thus avoid the race between multipath and udev/dmsetup creating device nodes with default ownership and permissions.
Created attachment 378692 [details] systemtap script to monitor sys_chown on RHEL4 Found this stap script very useful when figuring out what was going on whilst reproducing the bug.
Created attachment 378693 [details] reproducer script Same reproducer script as BZ 518575. The setup instructions are at https://bugzilla.redhat.com/show_bug.cgi?id=518575#c0
Patch applied. Thanks.
(In reply to comment #12) > Patch applied. Thanks. Ben, what needinfo did you need? Sorry for not responding, I've been out for about 4 weeks. Cheers -- Mark
err.. I don't need any information. I just applied your patch to the RHEL4 code.
Reproduced this issue in device-mapper-multipath-0.4.5-36.el4 This is the multipath.conf: multipaths { multipath { wwid 11000 mode 0644 uid 500 gid 500 } multipath { wwid 12000 mode 0644 uid 500 gid 500 } multipath { wwid 13000 mode 0644 uid 500 gid 500 } } ==== uid=500(fge) gid=500(fge) groups=500(fge) This is the script for testing UID/GID/MODE: #!/bin/bash X=0 while [ $X -lt "10000" ]; do multipath -F multipath -v0 ls -l /dev/mapper | grep "brw-r--r-- 1 fge fge" |wc -l|grep 3 || break let X+=1 echo ${X} success done The old multipath package will fail within 10 times. Verified device-mapper-multipath-0.4.5-40.el4 has fixed this problem. UID, GID, MODE was success configured for 10000 times. Change bug into verify mode.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0243.html
Comment on attachment 378691 [details] patch against device-mapper-multipath-0.4.5-37.el4 for RHEL4 only The patch obviously looked fine, since I applied it. How the heck do I actually go about reviewing patches in bugzilla.