[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15348: [PATCH 11/19] libparted: don't canonicalize /dev/md/ paths (#
From: |
Phillip Susi |
Subject: |
bug#15348: [PATCH 11/19] libparted: don't canonicalize /dev/md/ paths (#872361) |
Date: |
Wed, 25 Sep 2013 11:56:52 -0400 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I still think this section of code is wrong for two reasons:
1) It should not skip canonicalization, but rather do it correctly
2) It should not be based on the path given, but on the dev_t
Examples:
parted /dev/disk/by-id/xxxxx print
parted /dev/vg/lv print
Because the string does not start with /dev/mapper, it is
canonicalized to /dev/dm-x. Instead it should notice the dev_t major
is device mapper, and use the dm api to read the name and append it to
"/dev/mapper" for the official name.
On 9/11/2013 3:25 PM, Brian C. Lane wrote:
> From: "Brian C. Lane" <address@hidden>
>
> 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.
>
> * libparted/device.c (ped_device_get): Don't canonicalize names
> that start with "/dev/md/". --- libparted/device.c | 7 +++++-- 1
> file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/libparted/device.c b/libparted/device.c index
> 738b320..cdcc117 100644 --- a/libparted/device.c +++
> b/libparted/device.c @@ -152,8 +152,11 @@ ped_device_get (const
> char* path) char* normal_path = NULL;
>
> PED_ASSERT (path != NULL); - /* Don't canonicalize /dev/mapper
> paths, see tests/symlink.c */ - if (strncmp (path, "/dev/mapper/",
> 12)) + /* Don't canonicalize /dev/mapper or /dev/md/ paths, see +
> tests/symlink.c + */ + if (strncmp (path, "/dev/mapper/", 12) && +
> strncmp (path, "/dev/md/", 8)) normal_path = canonicalize_file_name
> (path); if (!normal_path) /* Well, maybe it is just that the file
> does not exist.
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBAgAGBQJSQwfEAAoJEJrBOlT6nu75U4oIANFSZR6fU0vKIYLp/GIGjVOM
aqaPoBFpzWMfXoP4niJaKLm22Q0t50ckjl6Mv9iwoZbI2xHj0vaFCDwEttw6wCYZ
hLt6JLFmA3sZE8psSm9VeflCCgEIKVtOS4pq0S13eWcZhlW6JgMpbidHVg2Fvjkw
eBK2MUY0nga22J1B8Ib84ugv/RImatg/x2w1+xwfihon83MnKz5v9ZwybQ/bUHhc
Bm1xAbtihdfLUzSFoblAhQqdBdUnoUmlOaLsHch2ZY+/4cEu1H76WiHdLUcO6GZV
MjMh9UPZGVSvCmMtUgL7SmbAdsVy5EcaYTfzDPI/k9I5LaBsw2tRl97vUoEfMzc=
=b+wC
-----END PGP SIGNATURE-----
- bug#15356: [PATCH 00/19] Fedora parted patches, Brian C. Lane, 2013/09/11
- bug#15345: [PATCH 17/19] tests: Add btrfs and xfs to the fs probe test, Brian C. Lane, 2013/09/11
- bug#15346: [PATCH 01/19] libparted: copy pmbr_boot when duplicating GPT disk, Brian C. Lane, 2013/09/11
- bug#15347: [PATCH 18/19] libparted: Flush parent device on open (#962611), Brian C. Lane, 2013/09/11
- bug#15350: [PATCH 19/19] tests: Restrict gpt-header-munge to little-endian systems, Brian C. Lane, 2013/09/11
- bug#15348: [PATCH 11/19] libparted: don't canonicalize /dev/md/ paths (#872361), Brian C. Lane, 2013/09/11
- bug#15348: [PATCH 11/19] libparted: don't canonicalize /dev/md/ paths (#872361),
Phillip Susi <=
- bug#15349: [PATCH 10/19] libparted: mklabel to support EDEV DASD, Brian C. Lane, 2013/09/11
- bug#15353: [PATCH 12/19] tests: rewrite t6001 to use /dev/mapper, Brian C. Lane, 2013/09/11
- bug#15351: [PATCH 09/19] libparted: Avoid dasd as default disk type while probe, Brian C. Lane, 2013/09/11
- bug#15352: [PATCH 04/19] libparted: preserve the uuid on dm partitions (#832145), Brian C. Lane, 2013/09/11
- bug#15354: [PATCH 05/19] tests: Make sure dm UUIDs are not erased, Brian C. Lane, 2013/09/11
- bug#15355: [PATCH 02/19] tests: test creating 20 device-mapper partitions (#803108), Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 03/19] libparted: use dm_udev_wait (#698121), Brian C. Lane, 2013/09/11
- bug#15356: [PATCH 08/19] libparted: mklabel to support EAV DASD, Brian C. Lane, 2013/09/11