summaryrefslogtreecommitdiff
path: root/btrfs-corrupt-block.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-09-09 16:41:56 -0400
committerChris Mason <chris.mason@fusionio.com>2013-10-16 08:20:43 -0400
commitce5a3ef3c01ca37faa6f9752f8df95543e9fc4e2 (patch)
treedc25a290cf0a2d3cbe27f6f8feca9a5048ec39a6 /btrfs-corrupt-block.c
parent9e93f11b2ef81c45cd1acf517864872885897a73 (diff)
Btrfs-progs: make btrfsck fix backrefs that are broken
If you set an file extent item's disk_bytenr to something completely wrong we won't be able to fix this if it is the only one who has a ref on the original disk bytenr. Our extent records know exactly who is supposed to point at them, so if we have an extent record that has no backrefs we can go and try to lookup the backrefs ourselves. If these backrefs do not point to an extent record that was actually found then we can be pretty sure this extent record is valid and the backref is bogus. Then the verify_backref code can do its thing and reset the backref to point to the right extent record and we can all carry on. This fixes a user reported corruption. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'btrfs-corrupt-block.c')
0 files changed, 0 insertions, 0 deletions