Skip to contentSkip to conversation

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

PATCH Applied Satoru Takeuchi 2 participants 2 messages Mar 11, 2016 Btrfs file system

lore
Share & tools
lore
#0 lore raw

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

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'
  ================================

---
This patch can be applied to devel (commit: 5d038a7ed212)

---
 cmds-device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
cmds-device.c +2 -1
index 94ffdc5..e500638 100644
@@ -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);
Signature · 1 line
2.5.0
Applied
#1 lore raw
Quoted 7 lines · Satoru Takeuchi

Fix the following bug.

================================

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

It should work as follow.

================================

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

Applied, thanks.