Skip to contentSkip to conversation

btrfs-progs: dump-tree: add noscan option

PATCH Superseded Anand Jain 1 participant 1 message May 16, 2019

Subsystems (2)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Anand Jain

author
#0 lore raw

PATCH v6 1/1 btrfs-progs: dump-tree: add noscan option

From: Anand Jain <[email protected]>

The cli 'btrfs inspect dump-tree <dev>' will scan for the partner devices if any by default.

So as of now you can not inspect each mirrored device independently.

This patch adds noscan option, which when used won't scan the system for the partner devices, instead it just uses the devices provided in the argument.

For example:
btrfs inspect dump-tree --noscan <dev> [<dev>..]

This helps to debug degraded raid1 and raid10.

---
v5->v6: rebase on latest btrfs-progs::devel
v4->v5: nit: use %m to print error string.
changelog update.
v3->v4: change the patch title.
collapse scan_args() to its only parent cmd_inspect_dump_tree() (it was bit confusing).
update the change log.
update usage.
update man page.
v2->v3: make it scalable for more than two disks in noscan mode v1->v2: rename --degraded to --noscan

 Documentation/btrfs-inspect-internal.asciidoc |  5 +-
 cmds-inspect-dump-tree.c                      | 53 ++++++++++++++-----
 2 files changed, 45 insertions(+), 13 deletions(-)
Documentation/btrfs-inspect-internal.asciidoc +4 -1
index 210f18c30a40..c9962ab3b548 100644
@@ -61,7 +61,7 @@ specify which mirror to print, valid values are 0, 1 and 2 and the superblock
 must be present on the device with a valid signature, can be used together with
 '--force'
 
-*dump-tree* [options] <device>::
+*dump-tree* [options] <device> [device...]::
 (replaces the standalone tool *btrfs-debug-tree*)
 +
 Dump tree structures from a given device in textual form, expand keys to human
@@ -95,6 +95,9 @@ intermixed in the output
 --bfs::::
 use breadth-first search to print trees. the nodes are printed before all
 leaves
+--device::::
+do not scan the system for other partner device(s), only use the device(s)
+provided in the argument
 -t <tree_id>::::
 print only the tree with the specified ID, where the ID can be numerical or
 common name in a flexible human readable form
cmds-inspect-dump-tree.c +41 -12

111 lines not on this page · raw message

Signature · 1 line
2.20.1 (Apple Git-117)