Although btrfsck can rebuild the csum tree, but has the following problems for end users or sysadmins who is not familiar with btrfs. 1) No brief info on which tree is corrupted. In fact, after extent and chunk tree check, we iterate all the extents and should have a brief view about which tree is corrupted. We can info user the fact to give them a clear view about what to do next
2) No automatically csum tree rebuild. If btrfsck can rebuild csum tree when needed and possible, why not rebuild it? This patchset handles this 2 problems: Patch 1 will handle problem 1) and patch 2~3) to handle problem 2). Now csum tree will be automatically rebuilt if and only if csum tree is broken but all other tree is OK. Qu Wenruo (4): btrfs-progs: Report corrupted trees after check_chunks_and_extents() btrfs-progs: Continue repair even some extent reference can't be repaired and report result to user. btrfs-progs: Automatically rebuild csum/extent tree if no other tree has corrupted/missing extent. btrfs-progs: Remove all csum extents for init_csum cmds-check.c | 172 +++++++++++++++++++++++++++++++++++++++++++++++++++------- ctree.h | 4 ++ extent-tree.c | 108 ++++++++++++++++++++++++++++++++++++ 3 files changed, 263 insertions(+), 21 deletions(-) -- 2.2.1 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html