Hi all, Certain kinds of XFS metadata depend on the correctness of lower level metadata. For example, directory indexes depends on the directory data fork, which in turn depend on the directoyr inode to be correct. The current scrub code does not strictly preserve these dependencies if it has to defer a repair until phase 4, because phase 4 prioritizes repairs by type (corruption, then cross referencing, and then preening) and loses the ordering inherent in the previous phases. To solve this problem, reorganize the repair ticket to track all the repairs pending for a princpal object (inode, AG, etc.). This reduces memory requirements if an object requires more than one type of repair and makes it very easy to boost the priority of repairs so that they are attempted only after dependent data structures are fixed. If you're going to start using this mess, you probably ought to just pull from my git trees, which are linked below. This is an extraordinary way to destroy everything. Enjoy! Comments and questions are, as always, welcome. --D xfsprogs git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=scrub-repair-data-deps --- scrub/phase1.c | 9 - scrub/phase2.c | 53 +++---- scrub/phase3.c | 49 ++---- scrub/phase4.c | 10 - scrub/phase7.c | 9 - scrub/repair.c | 456 +++++++++++++++++++++++++++++++++++++------------------- scrub/repair.h | 23 ++- scrub/scrub.c | 288 +++++++++++------------------------ scrub/scrub.h | 135 ++++++++++++----- 9 files changed, 564 insertions(+), 468 deletions(-)