diff mbox series

[07/11] btrfs-progs: tune: add stdin device list

Message ID 6f4f5eb0d897033b6e4105b93ad4f1de422e6487.1686131669.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: btrfstune: accept multiple devices and cleanup | expand

Commit Message

Anand Jain June 7, 2023, 9:59 a.m. UTC
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 tune/main.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tune/main.c b/tune/main.c
index e38c1f6d3729..2ea737bd0c0f 100644
--- a/tune/main.c
+++ b/tune/main.c
@@ -232,7 +232,7 @@  int BOX_MAIN(btrfstune)(int argc, char *argv[])
 
 	set_argv0(argv);
 	device = argv[optind];
-	if (check_argc_exact(argc - optind, 1))
+	if (check_argc_min(argc - optind, 1))
 		return 1;
 
 	if (random_fsid && new_fsid_str) {
@@ -280,6 +280,14 @@  int BOX_MAIN(btrfstune)(int argc, char *argv[])
 		return 1;
 	}
 
+	/*
+	 * check_mounted_where() with noscan == true frees the scanned devices
+	 * scan the command line provided device list now.
+	 */
+	ret = btrfs_scan_stdin_devices(optind, argc, argv);
+	if (ret)
+		return 1;
+
 	root = open_ctree_fd(fd, device, 0, ctree_flags);
 
 	if (!root) {