From: Su Yue <suy.fnst@xxxxxxxxxxxxxx> This is part 2 of lowmem repair patchsets: 1. Change the way of traversal under lowmem check to use walk_up_tree_v2() and walk_down_tree_v2() and it scans all trees now. 2. Repair cases: block group missing, tree block backref missing, extent item mismatch, extent data mismatch and data extent backref missing. Methods to repair extent tree is similar as original mode. 1. Delete all wrong extents(REFERENCER_MISSING or REFERENCER_MISMATCH). 2. Traverse all trees and extent data to rebuild extent tree. some issues: 1. Because scan of all trees, the speed may be very very slow. 2. Unlike origin mode who gathers all things together and checks, extent tree repair in lowmem mode may print some incorrect information after check. But, data on disk is fine, next check should be OK. 3. After repair, some extent of extent tree nodes may be reported like "Extent buffer leak ....", but next check is fine. (I don't know what's wrong) The reason why lowmem check has to check all trees is list as [patch 2/6] commit message. Although I have tested those code by images which tree level is 2 or 3 and has snapshots with option(--init-extent-tree). I am still worried some corner cases. Su Yue (6): btrfs-progs: check: enable repair in lowmem mode btrfs-progs: check: change traversal way of lowmem mode btrfs-progs: check: delete wrong items in lowmem repair btrfs-progs: check: Introduce repair_chunk_item() [btrfs-progs: check: Introduce repair_tree_block_ref() btrfs-progs: check: Introduce repair_extent_data_item() cmds-check.c | 1262 +++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 943 insertions(+), 319 deletions(-) -- 2.7.4 -- 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
