Skip to contentSkip to conversation

btrfs-progs: add verbose option to btrfs device scan

PATCH Superseded Anand Jain 3 participants 9 messages Jul 15, 2019 – Aug 28, 2019 Btrfs file system

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Anand Jain

author
#0 lore raw

PATCH 1/1 btrfs-progs: add verbose option to btrfs device scan

To help debug device scan issues, add verbose option to btrfs device scan.

---
 cmds/device.c        | 8 ++++++--
 cmds/filesystem.c    | 2 +-
 common/device-scan.c | 4 +++-
 common/device-scan.h | 2 +-
 common/utils.c       | 2 +-
 disk-io.c            | 2 +-
 6 files changed, 13 insertions(+), 7 deletions(-)
cmds/device.c +6 -2
index 24158308a41b..2fa13e61f806 100644
@@ -313,6 +313,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 	int all = 0;
 	int ret = 0;
 	int forget = 0;
+	int verbose = 0;
 
 	optind = 0;
 	while (1) {
@@ -323,7 +324,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 			{ NULL, 0, NULL, 0}
 		};
 
-		c = getopt_long(argc, argv, "du", long_options, NULL);
+		c = getopt_long(argc, argv, "duv", long_options, NULL);
 		if (c < 0)
 			break;
 		switch (c) {
@@ -333,6 +334,9 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 		case 'u':
 			forget = 1;
 			break;
+		case 'v':
+			verbose = 1;
+			break;
 		default:
 			usage_unknown_option(cmd, argv);
 		}
@@ -354,7 +358,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 			}
 		} else {
 			printf("Scanning for Btrfs filesystems\n");
-			ret = btrfs_scan_devices();
+			ret = btrfs_scan_devices(verbose);
 			error_on(ret, "error %d while scanning", ret);
 			ret = btrfs_register_all_devices();
 			error_on(ret,
cmds/filesystem.c +1 -1
index 4f22089abeaa..37b23af36847 100644
@@ -746,7 +746,7 @@ devs_only:
 		else
 			ret = 1;
 	} else {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(0);
 	}
 
 	if (ret) {
common/device-scan.c +3 -1
index 2c5ae225f710..bea201b351f0 100644
@@ -351,7 +351,7 @@ void free_seen_fsid(struct seen_fsid *seen_fsid_hash[])
 	}
 }
 
-int btrfs_scan_devices(void)
+int btrfs_scan_devices(int verbose)
 {
 	int fd = -1;
 	int ret;
@@ -380,6 +380,8 @@ int btrfs_scan_devices(void)
 			continue;
 		/* if we are here its definitely a btrfs disk*/
 		strncpy_null(path, blkid_dev_devname(dev));
+		if (verbose)
+			printf("blkid: btrfs device: %s\n", path);
 
 		fd = open(path, O_RDONLY);
 		if (fd < 0) {
common/device-scan.h +1 -1
index eda2bae5c6c4..8017a27511b9 100644
@@ -29,7 +29,7 @@ struct seen_fsid {
 	int fd;
 };
 
-int btrfs_scan_devices(void);
+int btrfs_scan_devices(int verbose);
 int btrfs_register_one_device(const char *fname);
 int btrfs_register_all_devices(void);
 int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
common/utils.c +1 -1
index ad938409a94f..36ce89a025f1 100644
@@ -277,7 +277,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size,
 
 	/* scan other devices */
 	if (is_btrfs && total_devs > 1) {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(0);
 		if (ret)
 			return ret;
 	}
disk-io.c +1 -1
index be44eead5cef..4f52a29700ab 100644
@@ -1085,7 +1085,7 @@ int btrfs_scan_fs_devices(int fd, const char *path,
 	}
 
 	if (!skip_devices && total_devs != 1) {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(0);
 		if (ret)
 			return ret;
 	}
Signature · 1 line
2.21.0 (Apple Git-120)
#1 lore raw
Quoted 3 lines · Anand Jain

To help debug device scan issues, add verbose option to btrfs device scan.

I fail to see what this patch helps for. We get the path in case of errors, in case of success what good could the path be ?

Quoted 14 lines
---
 cmds/device.c        | 8 ++++++--
 cmds/filesystem.c    | 2 +-
 common/device-scan.c | 4 +++-
 common/device-scan.h | 2 +-
 common/utils.c       | 2 +-
 disk-io.c            | 2 +-
 6 files changed, 13 insertions(+), 7 deletions(-)
cmds/device.c +0 -0
index 24158308a41b..2fa13e61f806 100644

cmds/device.c static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv) · line 316

Quoted 4 lines
cmds/device.c +1 -0
@@ -313,6 +313,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 	int all = 0;
 	int ret = 0;
 	int forget = 0;
+	int verbose = 0;

nit: make it a bool.

Quoted 106 lines
cmds/device.c +5 -2
 	optind = 0;
 	while (1) {
@@ -323,7 +324,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 			{ NULL, 0, NULL, 0}
 		};
 
-		c = getopt_long(argc, argv, "du", long_options, NULL);
+		c = getopt_long(argc, argv, "duv", long_options, NULL);
 		if (c < 0)
 			break;
 		switch (c) {
@@ -333,6 +334,9 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 		case 'u':
 			forget = 1;
 			break;
+		case 'v':
+			verbose = 1;
+			break;
 		default:
 			usage_unknown_option(cmd, argv);
 		}
@@ -354,7 +358,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 			}
 		} else {
 			printf("Scanning for Btrfs filesystems\n");
-			ret = btrfs_scan_devices();
+			ret = btrfs_scan_devices(verbose);
 			error_on(ret, "error %d while scanning", ret);
 			ret = btrfs_register_all_devices();
 			error_on(ret,
cmds/filesystem.c +1 -1
index 4f22089abeaa..37b23af36847 100644
@@ -746,7 +746,7 @@ devs_only:
 		else
 			ret = 1;
 	} else {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(0);
 	}
 
 	if (ret) {
common/device-scan.c +3 -1
index 2c5ae225f710..bea201b351f0 100644
@@ -351,7 +351,7 @@ void free_seen_fsid(struct seen_fsid *seen_fsid_hash[])
 	}
 }
 
-int btrfs_scan_devices(void)
+int btrfs_scan_devices(int verbose)
 {
 	int fd = -1;
 	int ret;
@@ -380,6 +380,8 @@ int btrfs_scan_devices(void)
 			continue;
 		/* if we are here its definitely a btrfs disk*/
 		strncpy_null(path, blkid_dev_devname(dev));
+		if (verbose)
+			printf("blkid: btrfs device: %s\n", path);
 
 		fd = open(path, O_RDONLY);
 		if (fd < 0) {
common/device-scan.h +1 -1
index eda2bae5c6c4..8017a27511b9 100644
@@ -29,7 +29,7 @@ struct seen_fsid {
 	int fd;
 };
 
-int btrfs_scan_devices(void);
+int btrfs_scan_devices(int verbose);
 int btrfs_register_one_device(const char *fname);
 int btrfs_register_all_devices(void);
 int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
common/utils.c +1 -1
index ad938409a94f..36ce89a025f1 100644
@@ -277,7 +277,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size,
 
 	/* scan other devices */
 	if (is_btrfs && total_devs > 1) {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(0);
 		if (ret)
 			return ret;
 	}
disk-io.c +1 -1
index be44eead5cef..4f52a29700ab 100644
@@ -1085,7 +1085,7 @@ int btrfs_scan_fs_devices(int fd, const char *path,
 	}
 
 	if (!skip_devices && total_devs != 1) {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(0);
 		if (ret)
 			return ret;
 	}
author
#2 lore raw
Quoted 13 lines · Nikolay Borisov
Quoted 3 lines · Anand Jain

To help debug device scan issues, add verbose option to btrfs device scan.

I fail to see what this patch helps for.

To know what are the devices path scanned.

Quoted 1 line

We get the path in case of errors,

No. We get the devices path when we use -v option and the cli [1] can be success / fail.
[1] 'btrfs device scan -v'

Quoted 14 lines

in case of success what good could the path be ?

Quoted 9 lines

---

cmds/device.c        | 8 ++++++--
cmds/filesystem.c    | 2 +-
common/device-scan.c | 4 +++-
common/device-scan.h | 2 +-
common/utils.c       | 2 +-
disk-io.c            | 2 +-
6 files changed, 13 insertions(+), 7 deletions(-)
Quoted 11 lines

cmds/device.c static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv) · line 316

Quoted 9 lines
cmds/device.c +1 -0
index 24158308a41b..2fa13e61f806 100644
@@ -313,6 +313,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 	int all = 0;
 	int ret = 0;
 	int forget = 0;
+	int verbose = 0;

nit: make it a bool.

yep. Will do.

Thanks, Anand

#3 lore raw
In reply to Nikolay Borisov
Quoted 9 lines · Nikolay Borisov
Quoted 3 lines · Anand Jain

To help debug device scan issues, add verbose option to btrfs device scan.

I fail to see what this patch helps for. We get the path in case of errors, in case of success what good could the path be ?

AFAIK it would provide an easy way to debug blkid related bug.

E.g. scan only works on some devices and misses some devices.

So it makes sense to me, although "debug" would be more suitable in this case.

Thanks,
Qu

Quoted 129 lines
Quoted 16 lines

---
 cmds/device.c        | 8 ++++++--
 cmds/filesystem.c    | 2 +-
 common/device-scan.c | 4 +++-
 common/device-scan.h | 2 +-
 common/utils.c       | 2 +-
 disk-io.c            | 2 +-
 6 files changed, 13 insertions(+), 7 deletions(-)
cmds/device.c +0 -0
index 24158308a41b..2fa13e61f806 100644

cmds/device.c static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv) · line 316

Quoted 4 lines
cmds/device.c +1 -0
@@ -313,6 +313,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 	int all = 0;
 	int ret = 0;
 	int forget = 0;
+	int verbose = 0;

nit: make it a bool.

Quoted 106 lines
cmds/device.c +5 -2
 	optind = 0;
 	while (1) {
@@ -323,7 +324,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 			{ NULL, 0, NULL, 0}
 		};
 
-		c = getopt_long(argc, argv, "du", long_options, NULL);
+		c = getopt_long(argc, argv, "duv", long_options, NULL);
 		if (c < 0)
 			break;
 		switch (c) {
@@ -333,6 +334,9 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 		case 'u':
 			forget = 1;
 			break;
+		case 'v':
+			verbose = 1;
+			break;
 		default:
 			usage_unknown_option(cmd, argv);
 		}
@@ -354,7 +358,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 			}
 		} else {
 			printf("Scanning for Btrfs filesystems\n");
-			ret = btrfs_scan_devices();
+			ret = btrfs_scan_devices(verbose);
 			error_on(ret, "error %d while scanning", ret);
 			ret = btrfs_register_all_devices();
 			error_on(ret,
cmds/filesystem.c +1 -1
index 4f22089abeaa..37b23af36847 100644
@@ -746,7 +746,7 @@ devs_only:
 		else
 			ret = 1;
 	} else {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(0);
 	}
 
 	if (ret) {
common/device-scan.c +3 -1
index 2c5ae225f710..bea201b351f0 100644
@@ -351,7 +351,7 @@ void free_seen_fsid(struct seen_fsid *seen_fsid_hash[])
 	}
 }
 
-int btrfs_scan_devices(void)
+int btrfs_scan_devices(int verbose)
 {
 	int fd = -1;
 	int ret;
@@ -380,6 +380,8 @@ int btrfs_scan_devices(void)
 			continue;
 		/* if we are here its definitely a btrfs disk*/
 		strncpy_null(path, blkid_dev_devname(dev));
+		if (verbose)
+			printf("blkid: btrfs device: %s\n", path);
 
 		fd = open(path, O_RDONLY);
 		if (fd < 0) {
common/device-scan.h +1 -1
index eda2bae5c6c4..8017a27511b9 100644
@@ -29,7 +29,7 @@ struct seen_fsid {
 	int fd;
 };
 
-int btrfs_scan_devices(void);
+int btrfs_scan_devices(int verbose);
 int btrfs_register_one_device(const char *fname);
 int btrfs_register_all_devices(void);
 int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
common/utils.c +1 -1
index ad938409a94f..36ce89a025f1 100644
@@ -277,7 +277,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size,
 
 	/* scan other devices */
 	if (is_btrfs && total_devs > 1) {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(0);
 		if (ret)
 			return ret;
 	}
disk-io.c +1 -1
index be44eead5cef..4f52a29700ab 100644
@@ -1085,7 +1085,7 @@ int btrfs_scan_fs_devices(int fd, const char *path,
 	}
 
 	if (!skip_devices && total_devs != 1) {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(0);
 		if (ret)
 			return ret;
 	}
author
#4 lore raw
Quoted 17 lines · Qu Wenruo
Quoted 9 lines · Nikolay Borisov
Quoted 3 lines · Anand Jain

To help debug device scan issues, add verbose option to btrfs device scan.

I fail to see what this patch helps for. We get the path in case of errors, in case of success what good could the path be ?

Quoted 6 lines

AFAIK it would provide an easy way to debug blkid related bug.

E.g. scan only works on some devices and misses some devices.

So it makes sense to me, although "debug" would be more suitable in this case.

As the objective is to show the devices scanned with
its device path, so IMO verbose would be suitable? Its a small change, can be modified at the time of integration. Will send V2 with a nit fix to use bool instead of int.

Thanks, Anand

#5 lore raw
In reply to Qu Wenruo
Quoted 8 lines · Qu Wenruo
Quoted 5 lines · Nikolay Borisov
Quoted 2 lines · Anand Jain

To help debug device scan issues, add verbose option to btrfs device scan.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I fail to see what this patch helps for. We get the path in case of errors, in case of success what good could the path be ?

AFAIK it would provide an easy way to debug blkid related bug.

E.g. scan only works on some devices and misses some devices.

In this case (and I already debugged one such case) it's invaluable to use LIBBLKID_DEBUG environment variable, the debug string added in this patch won't help in this particular case.

<snip>

author
#6 lore raw
Quoted 22 lines · Nikolay Borisov
Quoted 15 lines · Qu Wenruo
Quoted 9 lines · Nikolay Borisov
Quoted 3 lines · Anand Jain

To help debug device scan issues, add verbose option to btrfs device scan.

I fail to see what this patch helps for. We get the path in case of errors, in case of success what good could the path be ?

AFAIK it would provide an easy way to debug blkid related bug.

Quoted 7 lines
Quoted 1 line

E.g. scan only works on some devices and misses some devices.

In this case (and I already debugged one such case) it's invaluable to use LIBBLKID_DEBUG environment variable, the debug string added in this patch won't help in this particular case.

<snip>

Export LIBBLKID_DEBUG=all is good for debugging libblkid itself, btrfs dev scan -v provides a confirmation on which devices were scanned and their paths.

Thanks, Anand

author
#7 lore raw

PATCH v2 1/1 btrfs-progs: add verbose option to btrfs device scan

In reply to Anand Jain

To help debug device scan issues, add verbose option to btrfs device scan.

---
v2: Use bool instead of int as a btrfs_scan_device() argument.

 cmds/device.c        | 8 ++++++--
 cmds/filesystem.c    | 2 +-
 common/device-scan.c | 4 +++-
 common/device-scan.h | 3 ++-
 common/utils.c       | 2 +-
 disk-io.c            | 2 +-
 6 files changed, 14 insertions(+), 7 deletions(-)
cmds/device.c +6 -2
index 24158308a41b..9b715ffc42a3 100644
@@ -313,6 +313,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 	int all = 0;
 	int ret = 0;
 	int forget = 0;
+	bool verbose = false;
 
 	optind = 0;
 	while (1) {
@@ -323,7 +324,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 			{ NULL, 0, NULL, 0}
 		};
 
-		c = getopt_long(argc, argv, "du", long_options, NULL);
+		c = getopt_long(argc, argv, "duv", long_options, NULL);
 		if (c < 0)
 			break;
 		switch (c) {
@@ -333,6 +334,9 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 		case 'u':
 			forget = 1;
 			break;
+		case 'v':
+			verbose = true;
+			break;
 		default:
 			usage_unknown_option(cmd, argv);
 		}
@@ -354,7 +358,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
 			}
 		} else {
 			printf("Scanning for Btrfs filesystems\n");
-			ret = btrfs_scan_devices();
+			ret = btrfs_scan_devices(verbose);
 			error_on(ret, "error %d while scanning", ret);
 			ret = btrfs_register_all_devices();
 			error_on(ret,
cmds/filesystem.c +1 -1
index 4f22089abeaa..02d47a43a792 100644
@@ -746,7 +746,7 @@ devs_only:
 		else
 			ret = 1;
 	} else {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(false);
 	}
 
 	if (ret) {
common/device-scan.c +3 -1
index 2c5ae225f710..71c91dee6a86 100644
@@ -351,7 +351,7 @@ void free_seen_fsid(struct seen_fsid *seen_fsid_hash[])
 	}
 }
 
-int btrfs_scan_devices(void)
+int btrfs_scan_devices(bool verbose)
 {
 	int fd = -1;
 	int ret;
@@ -380,6 +380,8 @@ int btrfs_scan_devices(void)
 			continue;
 		/* if we are here its definitely a btrfs disk*/
 		strncpy_null(path, blkid_dev_devname(dev));
+		if (verbose)
+			printf("blkid: btrfs device: %s\n", path);
 
 		fd = open(path, O_RDONLY);
 		if (fd < 0) {
common/device-scan.h +2 -1
index eda2bae5c6c4..3e473c48d1af 100644
@@ -1,6 +1,7 @@
 #ifndef __DEVICE_SCAN_H__
 #define __DEVICE_SCAN_H__
 
+#include <stdbool.h>
 #include "kerncompat.h"
 #include "ioctl.h"
 
@@ -29,7 +30,7 @@ struct seen_fsid {
 	int fd;
 };
 
-int btrfs_scan_devices(void);
+int btrfs_scan_devices(bool verbose);
 int btrfs_register_one_device(const char *fname);
 int btrfs_register_all_devices(void);
 int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
common/utils.c +1 -1
index ad938409a94f..07648f07fbd4 100644
@@ -277,7 +277,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size,
 
 	/* scan other devices */
 	if (is_btrfs && total_devs > 1) {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(false);
 		if (ret)
 			return ret;
 	}
disk-io.c +1 -1
index be44eead5cef..71ed78b671da 100644
@@ -1085,7 +1085,7 @@ int btrfs_scan_fs_devices(int fd, const char *path,
 	}
 
 	if (!skip_devices && total_devs != 1) {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(false);
 		if (ret)
 			return ret;
 	}
Signature · 1 line
2.21.0 (Apple Git-120)
author
#8 lore raw

Ping?

Thanks, Anand

Quoted 137 lines · Anand Jain

To help debug device scan issues, add verbose option to btrfs device scan.

---
v2: Use bool instead of int as a btrfs_scan_device() argument.

  cmds/device.c        | 8 ++++++--
  cmds/filesystem.c    | 2 +-
  common/device-scan.c | 4 +++-
  common/device-scan.h | 3 ++-
  common/utils.c       | 2 +-
  disk-io.c            | 2 +-
  6 files changed, 14 insertions(+), 7 deletions(-)
cmds/device.c +6 -2
index 24158308a41b..9b715ffc42a3 100644
@@ -313,6 +313,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
  	int all = 0;
  	int ret = 0;
  	int forget = 0;
+	bool verbose = false;
 
  	optind = 0;
  	while (1) {
@@ -323,7 +324,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
  			{ NULL, 0, NULL, 0}
  		};
 
-		c = getopt_long(argc, argv, "du", long_options, NULL);
+		c = getopt_long(argc, argv, "duv", long_options, NULL);
  		if (c < 0)
  			break;
  		switch (c) {
@@ -333,6 +334,9 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
  		case 'u':
  			forget = 1;
  			break;
+		case 'v':
+			verbose = true;
+			break;
  		default:
  			usage_unknown_option(cmd, argv);
  		}
@@ -354,7 +358,7 @@ static int cmd_device_scan(const struct cmd_struct *cmd, int argc, char **argv)
  			}
  		} else {
  			printf("Scanning for Btrfs filesystems\n");
-			ret = btrfs_scan_devices();
+			ret = btrfs_scan_devices(verbose);
  			error_on(ret, "error %d while scanning", ret);
  			ret = btrfs_register_all_devices();
  			error_on(ret,
cmds/filesystem.c +1 -1
index 4f22089abeaa..02d47a43a792 100644
@@ -746,7 +746,7 @@ devs_only:
  		else
  			ret = 1;
  	} else {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(false);
  	}
 
  	if (ret) {
common/device-scan.c +3 -1
index 2c5ae225f710..71c91dee6a86 100644
@@ -351,7 +351,7 @@ void free_seen_fsid(struct seen_fsid *seen_fsid_hash[])
  	}
  }
 
-int btrfs_scan_devices(void)
+int btrfs_scan_devices(bool verbose)
  {
  	int fd = -1;
  	int ret;
@@ -380,6 +380,8 @@ int btrfs_scan_devices(void)
  			continue;
  		/* if we are here its definitely a btrfs disk*/
  		strncpy_null(path, blkid_dev_devname(dev));
+		if (verbose)
+			printf("blkid: btrfs device: %s\n", path);
 
  		fd = open(path, O_RDONLY);
  		if (fd < 0) {
common/device-scan.h +2 -1
index eda2bae5c6c4..3e473c48d1af 100644
@@ -1,6 +1,7 @@
  #ifndef __DEVICE_SCAN_H__
  #define __DEVICE_SCAN_H__
 
+#include <stdbool.h>
  #include "kerncompat.h"
  #include "ioctl.h"
 
@@ -29,7 +30,7 @@ struct seen_fsid {
  	int fd;
  };
 
-int btrfs_scan_devices(void);
+int btrfs_scan_devices(bool verbose);
  int btrfs_register_one_device(const char *fname);
  int btrfs_register_all_devices(void);
  int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
common/utils.c +1 -1
index ad938409a94f..07648f07fbd4 100644
@@ -277,7 +277,7 @@ int check_mounted_where(int fd, const char *file, char *where, int size,
 
  	/* scan other devices */
  	if (is_btrfs && total_devs > 1) {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(false);
  		if (ret)
  			return ret;
  	}
disk-io.c +1 -1
index be44eead5cef..71ed78b671da 100644
@@ -1085,7 +1085,7 @@ int btrfs_scan_fs_devices(int fd, const char *path,
  	}
 
  	if (!skip_devices && total_devs != 1) {
-		ret = btrfs_scan_devices();
+		ret = btrfs_scan_devices(false);
  		if (ret)
  			return ret;
  	}