summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
authorNithya Balachandran <nbalacha@redhat.com>2015-08-27 13:10:18 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-08-31 21:11:52 -0700
commit8abb8f625b038dc676709f500255f051b008ea49 (patch)
tree8b61d0522115c441552ddc73d1cff313c21463c5 /xlators/storage/posix/src/posix.c
parent9e1e4ae03ab51c43817c044578603bc343063aa2 (diff)
cluster/dht: Don't set posix acls on linkto files
Posix acls on a linkto file change the file's permission bits and cause DHT to treat it as a non-linkto file.This happens on the migration failure of a file on which posix acls were set. The fix prevents posix acls from being set on a linkto file and copies them across only after a file has been successfully migrated. Change-Id: Iccf7ff6fba49fe05d691d9b83bf76a240848b212 BUG: 1258377 Signed-off-by: Nithya Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/12025 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Signed-off-by: N Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/12062 Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index b8bb47ac91d..cafe565c321 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -3231,7 +3231,7 @@ _handle_setxattr_keyvalue_pair (dict_t *d, char *k, data_t *v,
filler = tmp;
return posix_handle_pair (filler->this, filler->real_path, k, v,
- filler->flags);
+ filler->flags, filler->stbuf);
}
#ifdef GF_DARWIN_HOST_OS
@@ -3305,6 +3305,8 @@ posix_setxattr (call_frame_t *frame, xlator_t *this,
goto out;
}
+ posix_pstat(this, loc->gfid, real_path, &stbuf);
+
op_ret = -1;
dict_del (dict, GFID_XATTR_KEY);
@@ -3312,6 +3314,8 @@ posix_setxattr (call_frame_t *frame, xlator_t *this,
filler.real_path = real_path;
filler.this = this;
+ filler.stbuf = &stbuf;
+
#ifdef GF_DARWIN_HOST_OS
filler.flags = map_xattr_flags(flags);
#else
@@ -4476,7 +4480,7 @@ _handle_fsetxattr_keyvalue_pair (dict_t *d, char *k, data_t *v,
filler = tmp;
return posix_fhandle_pair (filler->this, filler->fdnum, k, v,
- filler->flags);
+ filler->flags, filler->stbuf);
}
int32_t
@@ -4509,11 +4513,14 @@ posix_fsetxattr (call_frame_t *frame, xlator_t *this,
}
_fd = pfd->fd;
+ posix_fdstat (this, pfd->fd, &stbuf);
+
dict_del (dict, GFID_XATTR_KEY);
dict_del (dict, GF_XATTR_VOL_ID_KEY);
filler.fdnum = _fd;
filler.this = this;
+ filler.stbuf = &stbuf;
#ifdef GF_DARWIN_HOST_OS
filler.flags = map_xattr_flags(flags);
#else