]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/vdev_id/vdev_id
vdev_id: Fix partition regular expression
authorTony Hutter <hutter2@llnl.gov>
Wed, 24 Feb 2021 17:58:46 +0000 (09:58 -0800)
committerGitHub <noreply@github.com>
Wed, 24 Feb 2021 17:58:46 +0000 (09:58 -0800)
commit3ee4e6d8b7925d3b83dd7745e873d27983f9e995
treede1d2ffffdae021d8b0f2b0f2b568ebb626cc046
parent1dfc82a14ed538992f5c37a152995e93ede10469
vdev_id: Fix partition regular expression

Given a DM device name, the old vdev_id script would extract any text
after a 'p' as the partition number.  It then appends "-part" + the
partition number to the name, giving a by-vdev name like "L0-part5".

This works fine if the DM name is like 'dm-2p5', but doesn't work if
the DM name is a multipath name like "mpatha".  In those cases it
incorrectly matches the 'p' in "mpatha", giving by-vdev names like
"L0-partatha".

This patch fixes the issue by making the partition regex match stricter.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #11637
cmd/vdev_id/vdev_id