From 34a5ec12eedbd13f47c92108e4fb27e08598219a Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Tue, 3 Feb 2015 09:48:57 -0500 Subject: Btrfs-progs: skip opening all devices with restore When we go to fixup the dev items after a restore we scan all existing devices. If you happen to be a btrfs developer you could possibly open up some random device that you didn't just restore onto, which gives you weird errors and makes you super cranky and waste a day trying to figure out what is failing. This will make it so that we use the fd we've already opened for opening our ctree. Thanks, Signed-off-by: Josef Bacik --- disk-io.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'disk-io.h') diff --git a/disk-io.h b/disk-io.h index f963a96..53df8f0 100644 --- a/disk-io.h +++ b/disk-io.h @@ -33,6 +33,7 @@ enum btrfs_open_ctree_flags { OPEN_CTREE_RESTORE = (1 << 4), OPEN_CTREE_NO_BLOCK_GROUPS = (1 << 5), OPEN_CTREE_EXCLUSIVE = (1 << 6), + OPEN_CTREE_NO_DEVICES = (1 << 7), }; static inline u64 btrfs_sb_offset(int mirror) @@ -68,7 +69,7 @@ void btrfs_release_all_roots(struct btrfs_fs_info *fs_info); 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, - int super_recover); + int super_recover, int skip_devices); int btrfs_setup_chunk_tree_and_device_map(struct btrfs_fs_info *fs_info); struct btrfs_root *open_ctree(const char *filename, u64 sb_bytenr, -- cgit v1.2.1