linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
To: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: [PATCH] btrfs-progs: Fix device scan to interpret its argument properly
Date: Fri, 11 Mar 2016 09:26:13 +0900	[thread overview]
Message-ID: <56E210A5.8030100@jp.fujitsu.com> (raw)

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

             reply	other threads:[~2016-03-11  0:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-11  0:26 Satoru Takeuchi [this message]
2016-03-11 11:22 ` [PATCH] btrfs-progs: Fix device scan to interpret its argument properly David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E210A5.8030100@jp.fujitsu.com \
    --to=takeuchi_satoru@jp.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).