Btrfs-progs: pass flag to control whether run ioctl in btrfs_scan_for_fsid()
[platform/upstream/btrfs-progs.git] / disk-io.c
index bc673c2..6281569 100644 (file)
--- a/disk-io.c
+++ b/disk-io.c
@@ -911,7 +911,7 @@ void btrfs_cleanup_all_caches(struct btrfs_fs_info *fs_info)
 
 int btrfs_scan_fs_devices(int fd, const char *path,
                          struct btrfs_fs_devices **fs_devices,
-                         u64 sb_bytenr)
+                         u64 sb_bytenr, int run_ioctl)
 {
        u64 total_devs;
        int ret;
@@ -926,7 +926,7 @@ int btrfs_scan_fs_devices(int fd, const char *path,
        }
 
        if (total_devs != 1) {
-               ret = btrfs_scan_for_fsid(1);
+               ret = btrfs_scan_for_fsid(run_ioctl);
                if (ret)
                        return ret;
        }
@@ -1005,7 +1005,7 @@ static struct btrfs_fs_info *__open_ctree_fd(int fp, const char *path,
        if (restore)
                fs_info->on_restoring = 1;
 
-       ret = btrfs_scan_fs_devices(fp, path, &fs_devices, sb_bytenr);
+       ret = btrfs_scan_fs_devices(fp, path, &fs_devices, sb_bytenr, 1);
        if (ret)
                goto out;