Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/3] Add repair function for btree and missing inode
@ 2014-12-04  2:52 Qu Wenruo
  2014-12-04  2:52 ` [PATCH 1/3] btrfs-progs: record and report leaf/node corruption in fs/subvol tree Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Qu Wenruo @ 2014-12-04  2:52 UTC (permalink / raw)
  To: linux-btrfs

When a leaf/node is corrupted in fs root, btrfsck will only complain
like "Check tree block failed, wanted=XXX, have=XXX" and skip wrong
leaf.
Such case will cause a lot of err, one of these err will mainly be
I_ERR_NO_INODE_ITEM.

This patchset will info user which leaf of the tree is corrupted and try
it best to recovery the missing inode.
Although this is just a basis for the large use case of
corrupted-leaf/node repair, it is already working if the corrupted leaf
contains no extent data, not to mention the normal inode_item missing
case.

TODO: 
1. Cooperate with extent tree check/recover
   Current extent tree check will not record EXTENT_DATA extents, which
   can be used to improve the inode type recovery.

   Also extent tree repair can't handle EXTENT_DATA extents if the key
   can't be find and cause btrfsck exit.

   Need to cooperate with it to handle leaf recover better.

2. Add file extent recovery function
   In some case, even we recover the inode item, its file extents can
   still discount.
   To provide a fully repair making it pass btrfsck, we still need to
   repair such case.

3. Enhance inode_record
   Need a better inode_record to provide search function about
   inode_ref/dir_index/dir_item for given parent or child inode number,
   to help inode type detection and extent<->inode relation mapping for
   EXTENT_DATA.

Qu Wenruo (3):
  btrfs-progs: record and report leaf/node corruption in fs/subvol tree
  btrfs-progs:fsck: Recover btree with some corrupted leaf/node.
  btrfs-progs: Add inode item rebuild function.

 cmds-check.c | 328 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 ctree.c      |   3 +
 ctree.h      |   3 +
 inode.c      |   6 +-
 4 files changed, 323 insertions(+), 17 deletions(-)

-- 
2.1.3


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-05  0:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-04  2:52 [PATCH 0/3] Add repair function for btree and missing inode Qu Wenruo
2014-12-04  2:52 ` [PATCH 1/3] btrfs-progs: record and report leaf/node corruption in fs/subvol tree Qu Wenruo
2014-12-04  2:52 ` [PATCH 2/3] btrfs-progs:fsck: Recover btree with some corrupted leaf/node Qu Wenruo
2014-12-04 17:35   ` David Sterba
2014-12-05  0:22     ` Qu Wenruo
2014-12-05  0:26       ` Qu Wenruo
2014-12-04  2:52 ` [PATCH 3/3] btrfs-progs: Add inode item rebuild function Qu Wenruo
2014-12-04 17:41   ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox