From 4ae86b077d1ef4cd0cb3f73397bb474026b3362f Mon Sep 17 00:00:00 2001 From: Saravanakumar Arumugam Date: Fri, 8 Jul 2016 19:10:45 +0530 Subject: geo-rep: filter out xtime attribute during getxattr georep gsyncd's xtime needs to filtered irrespective of any process access. This way, we can avoid (unnecessarily)syncing xtime attribute to slave, which may raise permission denied errors. test case modified to check for xtime xattr only in backend. Back port of> >BUG: 1353952 >Signed-off-by: Saravanakumar Arumugam >Signed-off-by: Mohammed Rafi KC >Reviewed-on: https://review.gluster.org/14880 >Smoke: Gluster Build System >Reviewed-by: Kotresh HR >Tested-by: Kotresh HR >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System >Reviewed-by: Pranith Kumar Karampuri Change-Id: I2390b703048d5cc747d91fa2ae884dc55de58669 BUG: 1441576 Signed-off-by: Mohammed Rafi KC Reviewed-on: https://review.gluster.org/17046 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Raghavendra Talur --- xlators/storage/posix/src/posix.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'xlators/storage/posix/src/posix.c') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index e8aeced59f9..f53207fc5a8 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -4396,11 +4396,10 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, op_ret = -1; priv = this->private; - /* Allow access to stime xattr only to geo-rep worker */ - if (frame->root->pid != GF_CLIENT_PID_GSYNCD && name && - fnmatch ("*.glusterfs.*.stime", name, FNM_PERIOD) == 0) { + ret = posix_handle_georep_xattrs (frame, name, &op_errno, _gf_true); + if (ret == -1) { op_ret = -1; - op_errno = ENOATTR; + /* errno should be set from the above function*/ goto out; } @@ -4713,8 +4712,10 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, list_offset = 0; while (remaining_size > 0) { strncpy (keybuffer, list + list_offset, sizeof(keybuffer)); - if (frame->root->pid != GF_CLIENT_PID_GSYNCD && - fnmatch ("*.glusterfs.*.stime", keybuffer, FNM_PERIOD) == 0) + + ret = posix_handle_georep_xattrs (frame, keybuffer, NULL, + _gf_false); + if (ret == -1) goto ignore; size = sys_lgetxattr (real_path, keybuffer, NULL, 0); -- cgit