summaryrefslogtreecommitdiff
path: root/cmds-filesystem.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds-filesystem.c')
-rw-r--r--cmds-filesystem.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 8822695e..09cb37d9 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -468,7 +468,13 @@ static int btrfs_scan_kernel(void *search, unsigned unit_mode)
goto out;
}
- if (get_label_mounted(mnt->mnt_dir, label)) {
+ ret = get_label_mounted(mnt->mnt_dir, label);
+ /* provide backward kernel compatibility */
+ if (ret == -ENOTTY)
+ ret = get_label_unmounted(
+ (const char *)dev_info_arg->path, label);
+
+ if (ret) {
kfree(dev_info_arg);
goto out;
}