linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/2] btrfs-progs: dump-tree: Support print trees being half dropped
Date: Wed, 14 Aug 2019 09:04:38 +0800	[thread overview]
Message-ID: <20190814010440.15186-1-wqu@suse.com> (raw)

For half dropped subvolumes, dump-tree can sometimes lead to csum error
if the dropped tree blocks are also trimmed.

E.g
  node 33153024 level 1 items 61 free 60 generation 7 owner 256
  fs uuid 793daf87-b345-4896-a500-adf19baabd92
  chunk uuid 6fcfe63c-3a64-4e78-b095-5980186a0cc0
          key (256 INODE_ITEM 0) block 33173504 gen 7 <<< Dropped
          key (256 DIR_ITEM 266948847) block 30556160 gen 7
          key (256 DIR_ITEM 540403373) block 30658560 gen 7
  ...
  checksum verify failed on 33173504 found 295F0086 wanted 00000000
  checksum verify failed on 33173504 found 295F0086 wanted 00000000
  checksum verify failed on 33173504 found 295F0086 wanted 00000000
  bad tree block 33173504, bytenr mismatch, want=33173504, have=0
  failed to read 33173504 in tree 256


This patch will make btrfs ins dump-tree to detect dropped tree blocks
and output something like:

  node 33153024 level 1 items 61 free 60 generation 7 owner 256
  fs uuid 793daf87-b345-4896-a500-adf19baabd92
  chunk uuid 6fcfe63c-3a64-4e78-b095-5980186a0cc0
          key (256 INODE_ITEM 0) block 33173504 gen 7 =DROPPED=
          key (256 DIR_ITEM 266948847) block 30556160 gen 7 =DROPPED=
          key (256 DIR_ITEM 540403373) block 30658560 gen 7
  ...
  leaf 30658560 items 56 free space 172 generation 7 owner 256
  leaf 30658560 flags 0x1(WRITTEN) backref revision 1
  fs uuid 793daf87-b345-4896-a500-adf19baabd92
  chunk uuid 6fcfe63c-3a64-4e78-b095-5980186a0cc0
          item 0 key (256 DIR_ITEM 540403373) itemoff 3953 itemsize 42
                  location key (1045 INODE_ITEM 0) type FILE
                  transid 7 data_len 0 name_len 12
                  name: file_reg_394
  ...

And skip the dropped tree blocks completely.


Such problem also seems to affect original mode check, when dropped
subvolumes triggers false alert for missing backref.
But that problem needs more confirmation, and will be addressed in
another patchset.

Qu Wenruo (2):
  btrfs-progs: Introduce drop borderline for drop progress
  btrfs-progs: print-tree: Skip dropped tree blocks properly

 cmds/inspect-dump-tree.c | 33 ++++++++++++++------
 ctree.c                  | 31 +++++++++++++++++++
 ctree.h                  | 60 +++++++++++++++++++++++++++++++++++
 print-tree.c             | 67 ++++++++++++++++++++++++++++++++--------
 print-tree.h             |  4 ++-
 5 files changed, 171 insertions(+), 24 deletions(-)

-- 
2.22.0


             reply	other threads:[~2019-08-14  1:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14  1:04 Qu Wenruo [this message]
2019-08-14  1:04 ` [PATCH 1/2] btrfs-progs: Introduce drop borderline for drop progress Qu Wenruo
2019-08-14  1:04 ` [PATCH 2/2] btrfs-progs: print-tree: Skip dropped tree blocks properly Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190814010440.15186-1-wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).