On Wed, Jun 26, 2019 at 01:30:17AM -0700, Anand Jain wrote: > From: Anand Jain <anand.j...@oracle.com> > > 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. > > Signed-off-by: Anand Jain <anand.j...@oracle.com>
Added to devel, with some minor tweaks. Sorry for the delay. > --- > v6->v7: rebase on latest btrfs-progs::devel > 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(-) > > diff --git a/Documentation/btrfs-inspect-internal.asciidoc > b/Documentation/btrfs-inspect-internal.asciidoc > index 210f18c30a40..c9962ab3b548 100644 > --- a/Documentation/btrfs-inspect-internal.asciidoc > +++ b/Documentation/btrfs-inspect-internal.asciidoc > @@ -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:::: Minor typo, --noscan, fixed.