path: root/inode-item.c
diff options
authorJosef Bacik <>2013-05-08 11:40:36 -0400
committerChris Mason <>2013-06-19 13:52:25 -0400
commitef2a8889ef813ba77061f6a92f4954d047a78932 (patch)
tree4ca42385e930e550ceae1523633f74f19686a1e6 /inode-item.c
parent10f1af0fe7de5a0310657993c7c21a1d78087e56 (diff)
Btrfs-progs: make image restore with the original device offsets
I noticed a slight problem with btrfs-image, since it was building a chunk tree by setting the physical offset of the stripes to the same as the logical offset it created this problem where the super block was now mapped into the file system differently than it was before. This isn't a huge deal except that we also carry along the free space cache with us, which is setup with the idea that super at physical X is at logical Y. So this would make the free space checker in fsck freak out because it would see that the cache says that the super block is free space, and that the area where it thought the super block was located is in fact used. In the mount case we'd end up overwriting real metadata with backup super blocks. So we need to maintain the physical offsets in our stripes. This is a huge pain because we store the logical bytenrs of all of our metadata. This patch scans the entire image looking for chunk tree blocks and builds an in memory chunk tree so we can write logical blocks to their physical offsets. With this patch we no longer have the problems I described above. Thanks, Signed-off-by: Josef Bacik <> Signed-off-by: Chris Mason <>
Diffstat (limited to 'inode-item.c')
0 files changed, 0 insertions, 0 deletions