diff options
author | Csaba Henk <csaba@redhat.com> | 2019-07-25 08:27:24 +0200 |
---|---|---|
committer | Amar Tumballi <amarts@gmail.com> | 2019-11-07 08:10:41 +0000 |
commit | 5c05bc7bcfc47dfb5ead3c07fa42311bf88091b6 (patch) | |
tree | 31da898724551d2534757be4676bdf8d258f10df /xlators/mount | |
parent | 0fc68040b72fc94dec3874345547e294b9ec1f45 (diff) |
Improve logging of fusedump creation failure
updates bz#1193929
Signed-off-by: Csaba Henk <csaba@redhat.com>
Change-Id: I12cbe1d87f60fb497654d0e13e12171940867f76
Diffstat (limited to 'xlators/mount')
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 14 |
1 files changed, 10 insertions, 4 deletions
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; } |