Bug 1269968 - Partition on multipath device should not be a holder of that device.
Summary: Partition on multipath device should not be a holder of that device.
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: device-mapper-multipath
Version: 7.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: Ben Marzinski
QA Contact: Storage QE
Depends On:
TreeView+ depends on / blocked
Reported: 2015-10-08 16:09 UTC by mulhern
Modified: 2021-09-03 11:57 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-10-08 16:23:53 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description mulhern 2015-10-08 16:09:48 UTC
Description of problem:

holders/slaves relationship between multipath device and the partitions on that device is a very bad reflection of reality.

Version-Release number of selected component (if applicable):

Installed Packages
Name        : device-mapper-multipath
Arch        : x86_64
Version     : 0.4.9
Release     : 85.el7
Size        : 178 k
Repo        : installed
From repo   : RHEL-7-RTT

How reproducible:


Steps to Reproduce:
1. Multipath a bunch of device paths. Say paths are /dev/sda and /dev/sdb. mpath device is mpatha.
2. Create a partition on the device. This results in /dev/sda1 and /dev/sdb1 partitions, as well a a multipath partition, say mpatha1.
3. In sysfs, observe that mpatha1 is in holders of mpatha and that mpatha is a slave of mpatha1.

Actual results:

mpatha1 occurs in holders directory of mpatha, mpatha occurs in slaves directory of mpatha1.

Expected results:

Same as actual, but...

Additional info:

This seems like a bad representation of reality. Better to have mpatha1 be a subdirectory of mpatha's devicepath, just like sda1 is a subdirectory of sda's device path. A much more reasonable holder/slave relationship would be between mpatha1 and the partitions that it corresponds to, i.e., sda1 and sdb1.

Comment 1 Ben Marzinski 2015-10-08 16:23:53 UTC
This isn't an arbitrary decision. The current holder/slave relationship IS the reality here.

mpatha1 is not in reality a partition of mpatha. mpatha1 is a seperate device-mapper linear device that maps over the same part of mpatha as sda1 does over sda.  Multipath does some additional fancy work to make mpatha1 seem more like a partition. For instance, if you try to remove mpatha through multipath, it will automatically first remove mpatha1.  But multipath doesn't get to choose the holder/slave relationship.  That depends on how devices are actually set up in the system. Any program that wants to work with these stacked devices correctly, would need to know how they are actually related. For instance, if some other program wanted to disassemble a stack of devices including a multipath device and it's kpartx partition device, it would need to remove the partition device first, before it could remove the multipath device, because the partition device mpatha1 really is a holder of mpatha.

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