[PATCH v2] btrfs-progs: dump-tree: add degraded option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



btrfs inspect dump-tree cli picks the disk with the largest generation
to read the root tree, even when all the devices were not provided in
the cli. But in 2 disks RAID1 you may need to know what's in the disks
individually, so this option -x | --noscan indicates to use only the
given disk to dump.

Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>
---
v1->v2: rename --degraded to --noscan

 cmds-inspect-dump-tree.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/cmds-inspect-dump-tree.c b/cmds-inspect-dump-tree.c
index df44bb635c9c..d2676ce55af7 100644
--- a/cmds-inspect-dump-tree.c
+++ b/cmds-inspect-dump-tree.c
@@ -198,6 +198,7 @@ const char * const cmd_inspect_dump_tree_usage[] = {
 	"-u|--uuid              print only the uuid tree",
 	"-b|--block <block_num> print info from the specified block only",
 	"-t|--tree <tree_id>    print only tree with the given id (string or number)",
+	"-x|--noscan            use the disk in the arg, do not scan for the disks (for raid1)",
 	NULL
 };
 
@@ -234,10 +235,11 @@ int cmd_inspect_dump_tree(int argc, char **argv)
 			{ "uuid", no_argument, NULL, 'u'},
 			{ "block", required_argument, NULL, 'b'},
 			{ "tree", required_argument, NULL, 't'},
+			{ "noscan", no_argument, NULL, 'x'},
 			{ NULL, 0, NULL, 0 }
 		};
 
-		c = getopt_long(argc, argv, "deb:rRut:", long_options, NULL);
+		c = getopt_long(argc, argv, "deb:rRut:x", long_options, NULL);
 		if (c < 0)
 			break;
 		switch (c) {
@@ -286,6 +288,9 @@ int cmd_inspect_dump_tree(int argc, char **argv)
 			}
 			break;
 			}
+		case 'x':
+			open_ctree_flags |= OPEN_CTREE_NO_DEVICES;
+			break;
 		default:
 			usage(cmd_inspect_dump_tree_usage);
 		}
-- 
2.15.0

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux