All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] btrfs-progs: add the error message when open fails
Date: Thu, 09 Jun 2016 10:23:15 +0900	[thread overview]
Message-ID: <201606090123.AA00000@WIN-5MHF4RKU941.jp.fujitsu.com> (raw)

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

             reply	other threads:[~2016-06-09  1:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09  1:23 Tsutomu Itoh [this message]
2016-06-09 13:13 ` [PATCH] btrfs-progs: add the error message when open fails David Sterba
2016-06-09 23:32   ` Tsutomu Itoh
2016-07-08 15:08     ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201606090123.AA00000@WIN-5MHF4RKU941.jp.fujitsu.com \
    --to=t-itoh@jp.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.