diff options
authorAnand Jain <anand.jain@oracle.com>2015-09-15 16:46:23 +0800
committerDavid Sterba <dsterba@suse.com>2015-10-07 12:12:18 +0200
commit8d1ed12f7992be24c75ad50dba140b15e89d0992 (patch)
parentb6d0db75cd824ab9bd451f93ccab5b27e132bd8d (diff)
btrfs-progs: optimize not to scan repeated fsid mount points
fsid can be mounted multiple times, with different subvolid. And we don't have to scan a mount point if we already have that in the scanned list. And thus nicely avoids the following warning with multiple subvol mounts on older kernel like 2.6.32 where BTRFS_IOC_GET_FSLABEL ioctl does not exist. ./btrfs fi show -m Label: none uuid: 31845933-611e-422d-ae6f-386e57ad81aa Total devices 2 FS bytes used 172.00KiB devid 1 size 3.00GiB used 642.38MiB path /dev/sdd devid 2 size 3.00GiB used 622.38MiB path /dev/sde warning, device 2 is missing warning devid 2 not found already warning, device 2 is missing warning devid 2 not found already Signed-off-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 files changed, 4 insertions, 0 deletions
diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 02def40..3663734 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -468,6 +468,10 @@ static int btrfs_scan_kernel(void *search, unsigned unit_mode)
goto out;
+ /* skip all fs already shown as mounted fs */
+ if (is_seen_fsid(fs_info_arg.fsid))
+ continue;
ret = get_label_mounted(mnt->mnt_dir, label);
/* provide backward kernel compatibility */
if (ret == -ENOTTY)