summaryrefslogtreecommitdiff
path: root/extent-cache.h
diff options
context:
space:
mode:
authorNaohiro Aota <naota@elisp.net>2015-12-04 14:37:26 +0900
committerDavid Sterba <dsterba@suse.com>2016-01-12 15:01:02 +0100
commit9709d754db09629c0b540055b6abf7cfdcf480c8 (patch)
tree3a9a8979686f5b46dfe5730bacafb14cefeb6026 /extent-cache.h
parent05d4159946cf1f54e18729b708d2fd6c3a1225c4 (diff)
btrfs-progs: check, properly reset nlink of multi-linked file
If a file is linked from more than one directory and only one of the links is corrupted, btrfs check dose not reset the nlink properly. Actually it can go into infinite loop to link the broken file into lost+found. This patch fix two part of the code. The first one delay the freeing valid (no error, found inode ref, directory index, and directory item) backrefs. Freeing valid backrefs earier prevent reset_nlink() to add back all valid links. The second fix is obvious: passing `ref_type' to btrfs_add_link() is just wrong. It should be `filetype' instead. The current code can break all valid file links. Signed-off-by: Naohiro Aota <naota@elisp.net> Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'extent-cache.h')
0 files changed, 0 insertions, 0 deletions