When open in btrfs_open_devices failed, only the following message is
displayed. Therefore the user doesn't understand the reason why open
failed.

  # btrfs check /dev/sdb8
  Couldn't open file system

This patch adds the error message when open fails.

Signed-off-by: Tsutomu Itoh <t-i...@jp.fujitsu.com>
---
 volumes.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/volumes.c b/volumes.c
index ccfa732..80d61cf 100644
--- a/volumes.c
+++ b/volumes.c
@@ -227,6 +227,8 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, 
int flags)
                fd = open(device->name, flags);
                if (fd < 0) {
                        ret = -errno;
+                       error("cannot open '%s': %s", device->name,
+                             strerror(errno));
                        goto fail;
                }
 
-- 
2.8.1
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to