linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/13] btrfs-progs:fsck: Add inode nlink mismatch and
@ 2014-12-09  8:27 Qu Wenruo
  2014-12-09  8:27 ` [PATCH v4 01/13] btrfs-progs: print root dir verbose error in fsck Qu Wenruo
                   ` (13 more replies)
  0 siblings, 14 replies; 24+ messages in thread
From: Qu Wenruo @ 2014-12-09  8:27 UTC (permalink / raw)
  To: linux-btrfs

The patchset introduce two new repair function and some helpers to
archive a huge goal:
  Repair btrfs whose fs tree's non-root leaf/node is corrupted when no
  duplication is valid.

The two new repair functions are:
  repair_inode_nlinks():
    Repair any inode nlink related problem.
    From fixing the nlink number and related
    inode_ref/dir_index/dir_item to recovering file name and file type
    and salvage them into the lost+found dir.
    This does not only fix a case that some users reported but also
    cooperate with repair_inode_no_item() function to salvaged heavily
    damaged inode to lost+found dir.

  repair_inode_no_item():
    Repair case for inode_item missing case, which is quite common when
    fs tree leaf/node is missing.
    This only does the inode item rebuild. Later recovery like move it
    to lost+found dir is done by repair_inode_nlinks().

The main helper is the repair_btree() function, which will drops the
corrupted non-root leaf/node and rebalance the tree to keep the
correctness of the btree.

With this patchset, even a non-root leaf/node is corrupted and no
duplication survived, btrfsck can still repair it to a mountable status.
(And normal rw should also be OK,)

The remaining unfixable problems will be inode nbytes error with file
extent discounts error, which may be fixed in next patchset.

Cc David:
Sorry for the huge change in the patchset and merge the old inode nlink
repair with new inode item rebuild patchset.

Since when developing inode item rebuild patchset, I found the old nlink
cooperated very bad with item rebuild and there is some duplicated codes
between the two patchset, no to mention the math lib introduced by nlink
repair patch.
So I decided to somewhat rebase the nlink repair patchset to provide
better generality.

Sorry again for taking your extra time rebasing the patch.

Qu Wenruo (13):
  btrfs-progs: print root dir verbose error in fsck
  btrfs-progs: Import btrfs_insert/del/lookup_extref() functions.
  btrfs-progs: Import lookup/del_inode_ref() function.
  btrfs-progs: Add last_cache_extent() for extent-cache.
  btrfs-progs: Record highest inode number before repair.
  btrfs-progs: Add btrfs_unlink() and btrfs_add_link() functions.
  btrfs-progs: Add btrfs_mkdir() function for the incoming 'lost+found' 
       fsck mechanism.
  btrfs-progs: Add count_digit() function to help calculate filename
    len.
  btrfs-progs: Add helper function find_file_name/type for nlink and    
    inode_item repair.
  btrfs-progs: Add fixing function for inodes whose nlink dismatch
  btrfs-progs: record and report leaf/node corruption in fs/subvol tree
  btrfs-progs: Recover btree by dropping corrupted leaf/node.
  btrfs-progs: Add inode item rebuild function.

 Makefile       |   2 +-
 cmds-check.c   | 579 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 ctree.c        |   6 +
 ctree.h        |  44 +++++
 extent-cache.c |   9 +
 extent-cache.h |   1 +
 inode-item.c   | 318 +++++++++++++++++++++++++++++++
 inode.c        | 540 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 utils.h        |  18 ++
 9 files changed, 1493 insertions(+), 24 deletions(-)
 create mode 100644 inode.c

-- 
2.1.3


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

end of thread, other threads:[~2014-12-15  3:54 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-09  8:27 [PATCH v4 00/13] btrfs-progs:fsck: Add inode nlink mismatch and Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 01/13] btrfs-progs: print root dir verbose error in fsck Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 02/13] btrfs-progs: Import btrfs_insert/del/lookup_extref() functions Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 03/13] btrfs-progs: Import lookup/del_inode_ref() function Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 04/13] btrfs-progs: Add last_cache_extent() for extent-cache Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 05/13] btrfs-progs: Record highest inode number before repair Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 06/13] btrfs-progs: Add btrfs_unlink() and btrfs_add_link() functions Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 07/13] btrfs-progs: Add btrfs_mkdir() function for the incoming 'lost+found' fsck mechanism Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 08/13] btrfs-progs: Add count_digit() function to help calculate filename len Qu Wenruo
2014-12-10 12:45   ` David Sterba
2014-12-09  8:27 ` [PATCH v4 09/13] btrfs-progs: Add helper function find_file_name/type for nlink and inode_item repair Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 10/13] btrfs-progs: Add fixing function for inodes whose nlink dismatch Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 11/13] btrfs-progs: record and report leaf/node corruption in fs/subvol tree Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 12/13] btrfs-progs: Recover btree by dropping corrupted leaf/node Qu Wenruo
2014-12-09  8:27 ` [PATCH v4 13/13] btrfs-progs: Add inode item rebuild function Qu Wenruo
2014-12-10 12:37 ` [PATCH v4 00/13] btrfs-progs:fsck: Add inode nlink mismatch and David Sterba
2014-12-11  0:50   ` Qu Wenruo
2014-12-11 11:07     ` Filipe David Manana
2014-12-12  0:32       ` Qu Wenruo
2014-12-12  8:34         ` Filipe David Manana
2014-12-12  8:53           ` Qu Wenruo
2014-12-12 15:31           ` David Sterba
2014-12-15  1:25             ` Qu Wenruo
2014-12-15  3:54               ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).