summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2018-06-13 10:20:58 -0700
committerGitHub <[email protected]>2018-06-13 10:20:58 -0700
commit232dd8b956703bcc774524e78110d13de93dd5bd (patch)
treeeef1ccd56048f8f63121229dc21a3de44827209f /lib
parentab24877bd3459c84a9220a06acbbbfbb337e59a9 (diff)
Fix efi_get_info() zvol detection
Partition detection for zvol devices was not working correctly resulting inconsistent partitioning behavior when layering pools on top of zvols. This isn't a supported configuration but we'd still like it to work properly. Reviewed-by: George Melikov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #7624
Diffstat (limited to 'lib')
-rw-r--r--lib/libefi/rdwr_efi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libefi/rdwr_efi.c b/lib/libefi/rdwr_efi.c
index 4b78cc58e..08237237a 100644
--- a/lib/libefi/rdwr_efi.c
+++ b/lib/libefi/rdwr_efi.c
@@ -278,8 +278,9 @@ efi_get_info(int fd, struct dk_cinfo *dki_info)
} else if ((strncmp(dev_path, "/dev/zd", 7) == 0)) {
strcpy(dki_info->dki_cname, "zd");
dki_info->dki_ctype = DKC_MD;
- rval = sscanf(dev_path, "/dev/%[a-zA-Z]%hu",
- dki_info->dki_dname,
+ strcpy(dki_info->dki_dname, "zd");
+ rval = sscanf(dev_path, "/dev/zd%[0-9]p%hu",
+ dki_info->dki_dname + 2,
&dki_info->dki_partition);
} else if ((strncmp(dev_path, "/dev/dm-", 8) == 0)) {
strcpy(dki_info->dki_cname, "pseudo");