Bug 531131 - [RHEL4] Multipath UID/GID/MODE settings not always taking effect
Summary: [RHEL4] Multipath UID/GID/MODE settings not always taking effect
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: device-mapper-multipath
Version: 4.8
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Ben Marzinski
QA Contact: Gris Ge
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-27 00:26 UTC by Mark Goodwin
Modified: 2018-10-27 14:04 UTC (History)
28 users (show)

Fixed In Version: device-mapper-multipath-0.4.5-40.el4
Doc Type: Bug Fix
Doc Text:
Clone Of: 518575
Environment:
Last Closed: 2011-02-16 14:25:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch against device-mapper-multipath-0.4.5-37.el4 for RHEL4 only (1.99 KB, patch)
2009-12-16 05:53 UTC, Mark Goodwin
bmarzins: review+
Details | Diff
systemtap script to monitor sys_chown on RHEL4 (246 bytes, application/octet-stream)
2009-12-16 05:55 UTC, Mark Goodwin
no flags Details
reproducer script (219 bytes, application/x-sh)
2009-12-16 06:03 UTC, Mark Goodwin
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0243 0 normal SHIPPED_LIVE device-mapper-multipath bug fix and enhancement update 2011-02-15 16:34:54 UTC

Description Mark Goodwin 2009-10-27 00:26:27 UTC
+++ 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

Comment 6 Issue Tracker 2009-12-16 05:33:14 UTC
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

Comment 7 Mark Goodwin 2009-12-16 05:53:27 UTC
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.

Comment 8 Mark Goodwin 2009-12-16 05:55:37 UTC
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.

Comment 9 Mark Goodwin 2009-12-16 06:03:37 UTC
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

Comment 12 Ben Marzinski 2010-05-25 22:52:16 UTC
Patch applied. Thanks.

Comment 13 Mark Goodwin 2010-05-26 00:18:05 UTC
(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

Comment 14 Ben Marzinski 2010-05-26 14:54:25 UTC
err.. I don't need any information. I just applied your patch to the RHEL4 code.

Comment 16 Gris Ge 2011-01-12 07:49:34 UTC
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.

Comment 17 errata-xmlrpc 2011-02-16 14:25:39 UTC
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 18 Ben Marzinski 2014-06-09 15:28:25 UTC
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.


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