Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
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.
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.
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.
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
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.
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.
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
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
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.