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" <[email protected]>
> > 
> > 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)

Attachment: pgpX02hXvTqMV.pgp
Description: PGP signature

Reply via email to