linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: Fix device scan to interpret its argument properly
@ 2016-03-11  0:26 Satoru Takeuchi
  2016-03-11 11:22 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Satoru Takeuchi @ 2016-03-11  0:26 UTC (permalink / raw)
  To: linux-btrfs@vger.kernel.org

Fix the following bug.

  ================================
  # btrfs device scan -- /dev/sdb
  ERROR: not a block device: --
  ================================

It should work as follow.

  ================================
  # ./btrfs device scan -- /dev/sdb
  Scanning for Btrfs filesystems in '/dev/sdb'
  ================================

Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
---
This patch can be applied to devel (commit: 5d038a7ed212)
---
 cmds-device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cmds-device.c b/cmds-device.c
index 94ffdc5..e500638 100644
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -246,7 +246,7 @@ static const char * const cmd_device_scan_usage[] = {
 static int cmd_device_scan(int argc, char **argv)
 {
 	int i;
-	int devstart = 1;
+	int devstart;
 	int all = 0;
 	int ret = 0;

@@ -269,6 +269,7 @@ static int cmd_device_scan(int argc, char **argv)
 			usage(cmd_device_scan_usage);
 		}
 	}
+	devstart = optind;

 	if (all && check_argc_max(argc - optind, 1))
 		usage(cmd_device_scan_usage);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-11 11:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-11  0:26 [PATCH] btrfs-progs: Fix device scan to interpret its argument properly Satoru Takeuchi
2016-03-11 11:22 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).