Bug 596319

Summary: please cleanup 40-multipath.rules
Product: Red Hat Enterprise Linux 6 Reporter: Harald Hoyer <harald>
Component: device-mapper-multipathAssignee: Ben Marzinski <bmarzins>
Status: CLOSED CURRENTRELEASE QA Contact: Storage QE <storage-qe>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: agk, bdonahue, bmarzins, christophe.varoqui, dwysocha, egoggin, heinzm, junichi.nomura, kueda, lmb, mbroz, prockai, tranlan
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: device-mapper-multipath-0.4.9-22.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-10 20:10:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 595719, 597395    
Attachments:
Description Flags
40-multipath.rules none

Description Harald Hoyer 2010-05-26 15:30:14 UTC
Created attachment 416880 [details]
40-multipath.rules

Description of problem:
If a whole device is used for multipath, the underlying devices should have the partitions removed.

Please ship the attached 40-multipath.rules

This blocks bug 595719

Comment 2 Harald Hoyer 2010-05-26 17:14:44 UTC
btw, if the multipath rules would be a little bit later (70 instead of 40), you could honor the udev environment variables and skip the scsi_id run.

ID_SERIAL=3600a0b800034867a000005cd47d96f66
ID_WWN=0x600a0b800034867a
ID_WWN_VENDOR_EXTENSION=0x000005cd47d96f66
ID_WWN_WITH_EXTENSION=0x600a0b800034867a000005cd47d96f66

Comment 3 Harald Hoyer 2010-05-27 16:15:07 UTC
another optimization would also be only run "multipath -c" on non-partition devices.


SUBSYSTEM!="block", GOTO="end_mpath"
ENV{DEVTYPE}!="partition", \
   ENV{DM_MULTIPATH_DEVICE_PATH}!="1", \
   PROGRAM=="/sbin/multipath -c $tempnode", \
   ENV{DM_MULTIPATH_DEVICE_PATH}="1"

ENV{DM_MULTIPATH_DEVICE_PATH}=="1", \
   ENV{DEVTYPE}!="partition", \
   RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}"

RUN+="socket:/org/kernel/dm/multipath_event"

KERNEL!="dm-*", GOTO="end_mpath"
ACTION!="change", GOTO="end_mpath"
ENV{DM_SUSPENDED}=="1", GOTO="end_mpath"
ENV{DM_UUID}!="mpath-?*", GOTO="end_mpath"
ENV{DM_ACTION}=="PATH_FAILED", GOTO="end_mpath"
RUN+="$env{DM_SBIN_PATH}/kpartx -a -p p $tempnode"
LABEL="end_mpath"

Comment 4 Ben Marzinski 2010-05-28 22:45:37 UTC
Unfortunately, I do need to check if multipath is in /sbin or /usr/sbin.  It's necessary for anaconda, and unless I'm working on a dm device, I can't use $env{DM_SBIN_PATH}. The ENV{MPATH_GOT_HERE} was just debuginfo information that never got deleted from the patch, but the rest (or something like it) is necessary.  Otherwise the patch seems reasonable.

Comment 5 Harald Hoyer 2010-06-10 16:17:15 UTC
"/sbin/multipath -c" should only run on ACTION=="add"

Comment 6 Ben Marzinski 2010-06-16 23:30:27 UTC
Here are the new rules:

SUBSYSTEM!="block", GOTO="end_mpath"

ENV{MPATH_SBIN_PATH}="/sbin"
TEST!="$env{MPATH_SBIN_PATH}/multipath", ENV{MPATH_SBIN_PATH}="/usr/sbin"

ACTION=="add", ENV{DEVTYPE}!="partition", \
        ENV{DM_MULTIPATH_DEVICE_PATH}!="1", \
        PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -c $tempnode", \
        ENV{DM_MULTIPATH_DEVICE_PATH}="1"

ENV{DM_MULTIPATH_DEVICE_PATH}=="1", ENV{DEVTYPE}!="partition", \
        RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}"

RUN+="socket:/org/kernel/dm/multipath_event"
KERNEL!="dm-*", GOTO="end_mpath"
ACTION!="change", GOTO="end_mpath"
ENV{DM_SUSPENDED}=="1", GOTO="end_mpath"
ENV{DM_UUID}!="mpath-?*", GOTO="end_mpath"
ENV{DM_ACTION}=="PATH_FAILED", GOTO="end_mpath"
RUN+="$env{MPATH_SBIN_PATH}/kpartx -a -p p $tempnode"
LABEL="end_mpath"

Comment 7 Harald Hoyer 2010-06-17 08:10:59 UTC
fine, this might work

Comment 8 Ben Marzinski 2010-06-19 02:15:44 UTC
Done.

Comment 10 releng-rhel@redhat.com 2010-11-10 20:10:35 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.