summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
authorSaravanakumar Arumugam <sarumuga@redhat.com>2016-07-08 19:10:45 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2017-04-11 05:15:00 -0400
commitfddf202af078f09cf443fe76f8f43ad8eda2b4b6 (patch)
tree7d5bbe612fc13feead8cc70c4c875d7ec86cdddf /xlators/storage/posix/src/posix.c
parentc002b3d76486128ba78328b4a96ae0a1d8fe9cd0 (diff)
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. Change-Id: I2390b703048d5cc747d91fa2ae884dc55de58669 BUG: 1353952 Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com> Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: https://review.gluster.org/14880 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kotresh HR <khiremat@redhat.com> Tested-by: Kotresh HR <khiremat@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 7c05c8f1929..57575cc4c53 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -4419,11 +4419,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;
}
@@ -4736,8 +4735,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);