From 167f417f73d7877e7b5ea5bf72e66964d463d4b6 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Mon, 19 Dec 2016 09:14:44 +0530 Subject: dht : file rename operation is successful but log has error File exists Problem: file rename operation is successful but log has error 'key:trusted.glusterfs.dht.linkto error:File exists' Solution: The error comes in log only when file already has set this xattr (trusted.glusterfs.dht.linkto) before run rename operation and in that case sys_lsetxattr throws this kind of message. To avoid the error message in logs update the condition in posix_handle_pair. BUG: 1404905 Change-Id: Iafd8cb45f9d7f4fe247e297a6ef0af978a8d0b30 Signed-off-by: Mohit Agrawal Reviewed-on: http://review.gluster.org/16185 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Raghavendra G --- xlators/storage/posix/src/posix-helpers.c | 18 +++++++++++++----- xlators/storage/posix/src/posix.c | 9 +++++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 0af586e7777..3fa6dace327 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -1145,12 +1145,20 @@ posix_handle_pair (xlator_t *this, const char *real_path, value->len); #else /* ! DARWIN */ - gf_msg (this->name, GF_LOG_ERROR, errno, - P_MSG_XATTR_FAILED, "%s: key:%s" - "flags: %u length:%d", real_path, - key, flags, value->len); + if (errno == EEXIST) + gf_msg_debug (this->name, 0, + "%s: key:%s" + "flags: %u length:%d", + real_path, key, flags, + value->len); + else + gf_msg (this->name, GF_LOG_ERROR, errno, + P_MSG_XATTR_FAILED, "%s: key:%s" + "flags: %u length:%d", + real_path, key, flags, + value->len); #endif /* DARWIN */ - } + } goto out; } diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index a2886214364..c989d5527a1 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -1364,8 +1364,13 @@ post_op: ignore: op_ret = posix_entry_create_xattr_set (this, real_path, xdata); if (op_ret) { - gf_msg (this->name, GF_LOG_ERROR, 0, P_MSG_XATTR_FAILED, - "setting xattrs on %s failed", real_path); + if (errno != EEXIST) + gf_msg (this->name, GF_LOG_ERROR, errno, + P_MSG_XATTR_FAILED, + "setting xattrs on %s failed", real_path); + else + gf_msg_debug (this->name, 0, + "setting xattrs on %s failed", real_path); } if (!linked) { -- cgit