HomeFreeBSD

vdev_id: Fix partition regular expression

Description

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

Details

Provenance
Tony Hutter <hutter2@llnl.gov>Authored on Feb 24 2021, 5:58 PM
GitHub <noreply@github.com>Committed on Feb 24 2021, 5:58 PM
Parents
rG1dfc82a14ed5: Linux: increase max nvlist_src size
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG3ee4e6d8b792: vdev_id: Fix partition regular expression (authored by Tony Hutter <hutter2@llnl.gov>).Feb 24 2021, 5:58 PM