diff mbox

btrfs-progs: print errno string when /dev/btrfs-control open fails

Message ID 1363231039-7580-1-git-send-email-anand.jain@oracle.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Anand Jain March 14, 2013, 3:17 a.m. UTC
Of recently and intermittently I am seeing open fail
for /dev/btrfs-control (btrfs is loaded), and there are no
dmesg errors, this may not be a complete help in digging
this issue but something which is necessary.
Thanks

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 utils.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Sterba March 14, 2013, 10:41 p.m. UTC | #1
On Thu, Mar 14, 2013 at 11:17:19AM +0800, Anand Jain wrote:
>  		fprintf(stderr, "failed to open /dev/btrfs-control "
> -			"skipping device registration\n");
> +			"%s, skipping device registration\n",
> +			strerror(errno));

I think the common pattern here is that error details follow the
message, like

+			"skipping device registration: %s\n",

I'll fix it here, if you don't mind.

david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Anand Jain March 15, 2013, 1:37 a.m. UTC | #2
> I think the common pattern here is that error details follow the
> message, like
>
> +			"skipping device registration: %s\n",
>
> I'll fix it here, if you don't mind.

  Pls do. Thanks David.

-Anand
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/utils.c b/utils.c
index c29861b..17c6553 100644
--- a/utils.c
+++ b/utils.c
@@ -938,7 +938,8 @@  void btrfs_register_one_device(char *fname)
 	fd = open("/dev/btrfs-control", O_RDONLY);
 	if (fd < 0) {
 		fprintf(stderr, "failed to open /dev/btrfs-control "
-			"skipping device registration\n");
+			"%s, skipping device registration\n",
+			strerror(errno));
 		return;
 	}
 	strncpy(args.name, fname, BTRFS_PATH_NAME_MAX);