Bug 1269968

Summary: Partition on multipath device should not be a holder of that device.
Product: Red Hat Enterprise Linux 7 Reporter: mulhern <amulhern>
Component: device-mapper-multipathAssignee: Ben Marzinski <bmarzins>
Status: CLOSED NOTABUG QA Contact: Storage QE <storage-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: agk, bmarzins, heinzm, msnitzer, prajnoha
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-08 16:23:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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:

Always.

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.