From fda9270c906d955f735b0fc0f85818a435325f87 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Thu, 14 Jan 2016 17:14:25 +0530 Subject: geo-rep: Mask xtime and stime xattrs Allow access to xtime and stime xattrs only to gsyncd client and mask them for the rest. This is to prevent afr from performing self healing on marker xtime and geo-rep stime xattr which is not expected as each of which gets updated them from backend brick and should not be healed. BUG: 1313623 Change-Id: I9b4b3ce30bbc09d300e6d5c6782e2446f2411c6f Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/13242 NetBSD-regression: NetBSD Build System Reviewed-by: Vijaikumar Mallikarjuna Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Venky Shankar Reviewed-on: http://review.gluster.org/13572 Reviewed-by: Aravinda VK --- xlators/features/marker/src/marker.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'xlators/features/marker') diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c index 4a50d275a89..e82016fcadc 100644 --- a/xlators/features/marker/src/marker.c +++ b/xlators/features/marker/src/marker.c @@ -414,6 +414,21 @@ marker_filter_internal_xattrs (xlator_t *this, dict_t *xattrs) dict_foreach_match (xattrs, _is_quota_internal_xattr, ext, dict_remove_foreach_fn, NULL); +} + +static void +marker_filter_gsyncd_xattrs (call_frame_t *frame, + xlator_t *this, dict_t *xattrs) +{ + marker_conf_t *priv = NULL; + + priv = this->private; + GF_ASSERT (priv); + + if (frame->root->pid != GF_CLIENT_PID_GSYNCD && + dict_get(xattrs, priv->marker_xattr)) { + dict_del (xattrs, priv->marker_xattr); + } return; } @@ -423,7 +438,6 @@ marker_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, dict_t *xdata) { int32_t ret = -1; - if (op_ret < 0) goto unwind; @@ -459,6 +473,9 @@ marker_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, marker_filter_internal_xattrs (frame->this, dict); } + /* Filter gsyncd xtime xattr for non gsyncd clients */ + marker_filter_gsyncd_xattrs (frame, frame->this, dict); + unwind: MARKER_STACK_UNWIND (getxattr, frame, op_ret, op_errno, dict, xdata); return 0; -- cgit