path: root/volumes.c
diff options
authorTsutomu Itoh <>2016-06-09 10:23:15 +0900
committerDavid Sterba <>2016-07-13 18:44:52 +0200
commitdabd2835836cd77c765e3f500c349ffe126f458c (patch)
tree64238efb69801699f242c77838444b894bf5280d /volumes.c
parente67219255cca7b8e09789b6ca725fc4e9780da73 (diff)
btrfs-progs: add the error message when open fails
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 <> Signed-off-by: David Sterba <>
Diffstat (limited to 'volumes.c')
1 files changed, 2 insertions, 0 deletions
diff --git a/volumes.c b/volumes.c
index ccfa732e..b42a4126 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 device '%s': %s", device->name,
+ strerror(errno));
goto fail;