Add two repair functions to handle 2 types of file extent error: 1. Orphan file extents Orphan file extents are extent items whose type is DATA but its data backref is invalid(points to non-exists). This kind of corruption can occur when fs tree is corrupted but extent tree stay fine. The repair is to assume them as normal uncompressed file extent and re-insert them back to fs tree. 2. Discontinuous file extents This kind of corruption can be caused by kernel regression (although I didn't remember which patch can cause it) or fs tree leaf corruption. This one is relatively easy to handle, just punch hole to fill them. With this patchset, btrfsck should be able to fix most of cases when fs tree has leaf/node corruption. Btrfs-progs test cases will be follow soon. Qu Wenruo (5): btrfs-progs: Record orphan data extent ref to corresponding root. btrfs-progs: Add btrfs_get_extent() and btrfs_punch_hole(). btrfs-progs: Record and report every file extent hole. btrfs-progs: Add repair and report function for orphan file exntent. btrfs-progs: Add repair function for discount file extent hole. Makefile | 2 +- cmds-check.c | 509 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- ctree.h | 19 +++ disk-io.c | 1 + file.c | 162 +++++++++++++++++++ 5 files changed, 660 insertions(+), 33 deletions(-) create mode 100644 file.c -- 2.1.3 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
