RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1310320 - Add multipath option to disable kpartx partition creation
Summary: Add multipath option to disable kpartx partition creation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: device-mapper-multipath
Version: 6.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Ben Marzinski
QA Contact: Lin Li
Milan Navratil
URL:
Whiteboard:
Depends On:
Blocks: 1311659 1324930 1386360 1388229
TreeView+ depends on / blocked
 
Reported: 2016-02-20 10:24 UTC by Lukas Herbolt
Modified: 2017-03-21 10:49 UTC (History)
11 users (show)

Fixed In Version: device-mapper-multipath-0.4.9-94.el6
Doc Type: Release Note
Doc Text:
The "skip_kpartx" `multipath.conf` option to allow skipping `kpartx` partition creation has been added This update enables the user to only create a multipath device, and not any partitions, even if the device has a partition table. Now, multipath devices that are configured with the "skip_kpartx" option do not have any partition devices created for them.
Clone Of:
: 1311659 (view as bug list)
Environment:
Last Closed: 2017-03-21 10:49:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0697 0 normal SHIPPED_LIVE device-mapper-multipath bug fix and enhancement update 2017-03-21 12:39:06 UTC

Description Lukas Herbolt 2016-02-20 10:24:00 UTC
Description of problem:
As per man pages multipath has now new feature:
 - no_partitions:
       Disable automatic partitions generation via kpartx.

If you try to use this feature and recreate path it ends with error:
---
Feb 20 10:54:59 | libdevmapper: ioctl/libdm-iface.c(1795): dm info mpatha  NF   [16384] (*1)
Feb 20 10:54:59 | libdevmapper: libdm-common.c(763): Device uuid mangled [auto]: mpath-0QEMU    QEMU HARDDISK   virt005 --> mpath-0QEMU\x20\x20\x20\x20QEMU\x20HARDDISK\x20\x20\x20virt005
Feb 20 10:54:59 | libdevmapper: libdm-common.c(2196): Udev cookie 0xd4df1ac (semid 163842) incremented to 3
Feb 20 10:54:59 | libdevmapper: libdm-common.c(2446): Udev cookie 0xd4df1ac (semid 163842) assigned to CREATE task(0) with flags DISABLE_LIBRARY_FALLBACK         (0x20)
Feb 20 10:54:59 | libdevmapper: libdm-common.c(763): Device uuid mangled [auto]: mpath-0QEMU    QEMU HARDDISK   virt005 --> mpath-0QEMU\x20\x20\x20\x20QEMU\x20HARDDISK\x20\x20\x20virt005
Feb 20 10:54:59 | libdevmapper: ioctl/libdm-iface.c(1795): dm create mpatha mpath-0QEMU\x20\x20\x20\x20QEMU\x20HARDDISK\x20\x20\x20virt005 OF   [16384] (*1)
Feb 20 10:54:59 | libdevmapper: ioctl/libdm-iface.c(1795): dm reload mpatha  OF   [16384] (*1)
Feb 20 10:54:59 | libdevmapper: ioctl/libdm-iface.c(1813): device-mapper: reload ioctl on mpatha failed: Invalid argument
---

Breakpoint 1, _do_dm_ioctl (dmt=0x613ef0, command=3241737475, 
(gdb) 
buffer_repeat_count=<value optimized out>, retry_repeat_count=1, 
    retryable=0x7fffffffdeec) at ioctl/libdm-iface.c:1797
1797		if (ioctl(_control_fd, command, dmi) < 0 &&
(gdb) p ioctl(_control_fd, command, dmi)
$14 = -1
(gdb) p dmi
$15 = (struct dm_ioctl *) 0x613ff0
(gdb) p dmi->name 
$16 = "mpatha", '\000' <repeats 121 times>
(gdb) p dmi->uuid
$17 = "mpath-0QEMU\\x20\\x20\\x20\\x20QEMU\\x20HARDDISK\\x20\\x20\\x20virt005",
'\000' <repeats 66 times>
(gdb) p command
$18 = 3241737475
(gdb) p/x command
$19 = 0xc138fd03

If I understand correctly we are sending trough /dev/mapper/control ioctl which is not known to the DM.

Decoding the IOCTL: 0xc138fd03

11 0000010011100 011111101 00000011
^^ ^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^
|  |             |         ` function # 0x3    
|  |             | 
|  |             ` ASCI char 0xFD
|  |
|  ` Size of args 0x9c 
|  
`Read/Write


Version-Release number of selected component (if applicable):
device-mapper-multipath-0.4.9-87.el6.x86_64

How reproducible:
Add:
---
features                "1 no_partitions"
---
into the device section in your multipath and run multipath -r 


Steps to Reproduce:
1. Configure mulitpath with:
   features                "1 no_partitions"
   in your device section 

2. Reload multipath via multipath -r 


Actual results:
Depends on verbosity, with default you will get 
multipath -r 
Feb 20 11:20:04 | mpatha: ignoring map
Feb 20 11:20:04 | mpatha: ignoring map

and path is not reloaded or created.

Along with it you will get following lines in var/log/messages
---
Feb 20 11:20:04 rhel6-debug kernel: [46304.409986] device-mapper: table: 253:2: multipath: Unrecognised multipath feature request
Feb 20 11:20:04 rhel6-debug kernel: [46304.410865] device-mapper: ioctl: error adding target to table
Feb 20 11:20:04 rhel6-debug kernel: [46304.414974] device-mapper: table: 253:2: multipath: Unrecognised multipath feature request
Feb 20 11:20:04 rhel6-debug kernel: [46304.415840] device-mapper: ioctl: error adding target to table
---
Expected results:
Path should be correctly created or reloaded with feature.


Additional info:
Feature works on RHEL 7.

Comment 2 Lukas Herbolt 2016-02-20 11:39:07 UTC
ioctl ERR:
==========

11 00000100111000 11111101 00000011
^^ ^^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^
|  |              |         ` function # 0x3    
|  |              | 
|  |              ` ASCI char 0xFD
|  |
|  ` Size of args 0x138
|  
`Read/Write

Comment 3 Ben Marzinski 2016-02-22 19:31:53 UTC
The no_partitions feature method of solving the problem of skipping kpartx running wasn't accepted upstream. The problem still needs to be solved, but it will most likely get solved with a multipath.conf parameter that sets a udev flag that skips kpartx running.  The effect will be the same.

Comment 4 Lukas Herbolt 2016-02-24 09:59:43 UTC
Hi Ben,
Than you for info. Do you have the reject patch handy?
It's just my personal interest.

About the udev rules parameter, it's cool solution, do you any ETA?
Is there such a work already done in upstream?

Than you for the info.
Lukas

Comment 5 Ben Marzinski 2016-02-24 16:55:56 UTC
I don't currently have a patch, and nothing exists upstream for this. The device mapper udev cookies code has reserved bits that targets can use to set flags for use in udev processing.  multipath already uses DM_SUBSYSTEM_UDEV_FLAG0 to avoid executing rules when the device has just been reloaded because it has added or
removed paths. It's not too much work to make sure we set DM_SUBSYSTEM_UDEV_FLAG1 (for instance) whenever we would do a dm action that would otherwise cause kpartx to get run, and then check for this in the udev rules.

As for when this will get done. It's too late for this to make it into RHEL-6.8, so it will probably land first in RHEL-7.3 and upstream, and then go into RHEL-6.9.

Comment 7 Ben Marzinski 2016-10-15 19:12:40 UTC
Fix ported from RHEL7. It's pretty significantly different under the covers, since there were a lot of changes in this code from RHEL6 to RHEL7, but it should work exactly the same.

Comment 10 Lin Li 2016-12-27 08:44:33 UTC
Verified on device-mapper-multipath-0.4.9-99.el6
1. # man multipath.conf
defaults section
       skip_kpartx      If set to yes , kpartx will not automatically create partitions on the device. The default is no

multipaths section
       The following attributes are optional; if not set the default values are taken from the defaults or devices section:
              skip_kpartx

devices section
       The following attributes are optional; if not set the default values are taken from the defaults section:
              skip_kpartx

2. edit /etc/multipath.conf
defaults {

        find_multipaths yes
        user_friendly_names yes
        skip_kpartx yes
}

3. # multipath -r
reload: mpatha (360fff19abdd9552f8a36e5355226ba27) undef EQLOGIC,100E-00
size=50G features='0' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=1 status=undef
| `- 1:0:0:0 sda 8:0  active ready running
`-+- policy='round-robin 0' prio=1 status=undef
  `- 2:0:0:0 sdb 8:16 active ready running

4. edit /etc/multipath.conf
defaults {

        find_multipaths yes
        user_friendly_names yes
        skip_kpartx yes
}

multipaths {
        multipath {
                uid 0
                gid 0
                wwid "360fff19abdd9552f8a36e5355226ba27"
                mode 0600
                skip_kpartx yes
        }
}

5. # multipath -r
reload: mpatha (360fff19abdd9552f8a36e5355226ba27) undef EQLOGIC,100E-00
size=50G features='0' hwhandler='0' wp=undef
|-+- policy='round-robin 0' prio=1 status=undef
| `- 1:0:0:0 sda 8:0  active ready running
`-+- policy='round-robin 0' prio=1 status=undef
  `- 2:0:0:0 sdb 8:16 active ready running

Comment 14 errata-xmlrpc 2017-03-21 10:49:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0697.html


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