summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2016-01-14 17:14:25 +0530
committerVenky Shankar <vshankar@redhat.com>2016-02-26 01:52:12 -0800
commitbf2004bc1346890e69292c5177a5d8e002b696e2 (patch)
tree00ae6c412d78f434407ff93afd9becd3bed341fd /xlators/features
parent3f9632cd655f43fa66cca981b37cbfb09ab1d352 (diff)
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. Change-Id: I24c30f3cfac636a55fd55be989f8db9f8ca10856 BUG: 1296496 Signed-off-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/13242 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/marker/src/marker.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
index a2e91580175..10c7e04f21f 100644
--- a/xlators/features/marker/src/marker.c
+++ b/xlators/features/marker/src/marker.c
@@ -412,6 +412,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;
}
@@ -421,7 +436,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;
@@ -457,6 +471,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;