[parted-devel] [PATCH 1/2] libparted: don't canonicalize /dev/md/ paths
Brian C. Lane
bcl at redhat.com
Thu Jan 10 17:04:19 UTC 2013
On Wed, Jan 09, 2013 at 09:53:02AM -0500, Phillip Susi wrote:
> On 1/8/2013 7:02 PM, Brian C. Lane wrote:
> > From: "Brian C. Lane" <bcl at redhat.com>
> >
> > This is the same issue we have with /dev/mapper/ paths that was
> > fixed in commit c1eb485b9fd8919e18f192d678bc52b0488e6ee0. When
> > libparted is used to setup the device the symlink should be used to
> > reference it, not the backing device name which could change.
>
> What about the reverse? If the user specifies the backing device,
> don't we need to canonicalize it to the /dev/md/ path?
I don't think that ever happens.
>
> In other words, the problem is not canonicalizing the device, it's
> *how* it is canonicalized. Rather than just following the symlink, or
> using the user argument unmodified, we need to ask the kernel what the
> device's canonical ( /dev/md/ ) name is and use that.
The specific problem in this case is that a user of libparted (anaconda
via pyparted) calls libparted using the /dev/md/foo name and parted
follows the symlink. Later attempts to use the /dev/md/foo name fail
because libparted didn't keep track of the name that it was handed by
pyparted.
I don't think there is any need to ask the kernel about it. I'm not even
sure if it knows about the reverse relationship. In some cases this is
handled by mdadm, others by device-mapper.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/parted-devel/attachments/20130110/ff86fc4b/attachment.pgp>
More information about the parted-devel
mailing list