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 <t-itoh@jp.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
master
Tsutomu Itoh 2016-06-09 10:23:15 +09:00 committed by David Sterba
parent e67219255c
commit dabd283583
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}