btrfs-progs: fix device mapper path canonicalization

Commit 922eaa7b54 ("btrfs-progs: build: fix linking with static
libmount") broke path canonicalization, that prevented eg 'device add
/dev/dm-0' to properly recognize the device mapper names.

Issue: #339
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2021-02-10 16:36:50 +01:00
parent 1804dcaa4b
commit 2347b34af4

View file

@ -325,7 +325,7 @@ char *path_canonicalize(const char *path)
return strdup(path);
p = strrchr(canonical, '/');
if (p && strncmp(p, "/dm-", 4) == 0 && isdigit(*(p + 4))) {
char *dm = path_canonicalize(p + 1);
char *dm = path_canonicalize_dm_name(p + 1);
if (dm) {
free(canonical);