btrfs-progs: dump-tree: Support print trees being half dropped
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | btrfs-progs: Introduce drop borderline for drop progressctree.c ctree.h | +91 | 0 replies | |
| 2/2 | btrfs-progs: print-tree: Skip dropped tree blocks properlycmds/ print-tree.c print-tree.h | +80 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] btrfs-progs: dump-tree: Support print trees being half dropped
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(-)
Signature · 1 line
2.22.0