From 5c05bc7bcfc47dfb5ead3c07fa42311bf88091b6 Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Thu, 25 Jul 2019 08:27:24 +0200 Subject: Improve logging of fusedump creation failure updates bz#1193929 Signed-off-by: Csaba Henk Change-Id: I12cbe1d87f60fb497654d0e13e12171940867f76 --- xlators/mount/fuse/src/fuse-bridge.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'xlators/mount/fuse') diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 2ed8bbdcc44..5b24310f880 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -6650,12 +6650,18 @@ init(xlator_t *this_xl) ret = dict_get_str(options, "dump-fuse", &value_string); if (ret == 0) { ret = sys_unlink(value_string); - if (ret != -1 || errno == ENOENT) - ret = open(value_string, O_RDWR | O_CREAT | O_EXCL, - S_IRUSR | S_IWUSR); + if (ret == -1 && errno != ENOENT) { + gf_log("glusterfs-fuse", GF_LOG_ERROR, + "failed to remove old fuse dump file %s: %s", value_string, + strerror(errno)); + + goto cleanup_exit; + } + ret = open(value_string, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); if (ret == -1) { gf_log("glusterfs-fuse", GF_LOG_ERROR, - "cannot open fuse dump file %s", value_string); + "failed to open fuse dump file %s: %s", value_string, + strerror(errno)); goto cleanup_exit; } -- cgit