From f28ad306b348324b2b29ba0f7973dbae3a53d4e4 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Fri, 26 Sep 2014 09:02:49 -0400 Subject: Btrfs-progs: let btrfs-image actually work on a balanced fs We use the read extent buffer infrastructure to read the super block when we are creating a btrfs-image. This works out fine most of the time except when the fs has been balanced, then it fails to map the super block. So we could fix btrfs-image to read in the super in a special way, but thats more code. So instead just check in the eb reading code if we are reading the super and then don't bother mapping the block, just read the actual offset. This fixed some poor guy who was trying to btrfs-image his fs that had been balanced. Thanks, Signed-off-by: Josef Bacik Signed-off-by: David Sterba --- disk-io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'disk-io.c') diff --git a/disk-io.c b/disk-io.c index 26a532e4..34c0a972 100644 --- a/disk-io.c +++ b/disk-io.c @@ -201,7 +201,8 @@ int read_whole_eb(struct btrfs_fs_info *info, struct extent_buffer *eb, int mirr read_len = bytes_left; device = NULL; - if (!info->on_restoring) { + if (!info->on_restoring && + eb->start != BTRFS_SUPER_INFO_OFFSET) { ret = btrfs_map_block(&info->mapping_tree, READ, eb->start + offset, &read_len, &multi, mirror, NULL); -- cgit v1.2.3