Anand Jain
2013-Mar-14 03:17 UTC
[PATCH] btrfs-progs: print errno string when /dev/btrfs-control open fails
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(-) 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); -- 1.8.1.227.g44fe835 -- 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
David Sterba
2013-Mar-14 22:41 UTC
Re: [PATCH] btrfs-progs: print errno string when /dev/btrfs-control open fails
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
2013-Mar-15 01:37 UTC
Re: [PATCH] btrfs-progs: print errno string when /dev/btrfs-control open fails
> 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