diff mbox

btrfs-progs: Fix device scan to interpret its argument properly

Message ID 56E210A5.8030100@jp.fujitsu.com (mailing list archive)
State Accepted
Headers show

Commit Message

Satoru Takeuchi March 11, 2016, 12:26 a.m. UTC
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(-)

Comments

David Sterba March 11, 2016, 11:22 a.m. UTC | #1
On Fri, Mar 11, 2016 at 09:26:13AM +0900, Satoru Takeuchi wrote:
> 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>

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

Patch

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);