summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2017-11-20 09:09:20 +0530
committerN Balachandran <nbalacha@redhat.com>2017-11-20 09:09:52 +0530
commitf1071f17e02502c24375c0b480d369d37f4e4054 (patch)
tree5c8d2f54f2cdb8b7164520260436b3d90cb3ec09
parente37862dd3fc2982ef9a2fedd887033c6ccb5ff59 (diff)
cluster/dht: Don't set ACLs on linkto file
The trusted.SGI_ACL_FILE appears to set posix ACLs on the linkto file that is a target of file migration. This can mess up file permissions and cause linkto identification to fail. Now we remove all ACL xattrs from the results of the listxattr call on the source before setting them on the target. > BUG: 1514329 > Signed-off-by: N Balachandran <nbalacha@redhat.com> Change-Id: I56802dbaed783a16e3fb90f59f4ce849f8a4a9b4 BUG: 1515042 Signed-off-by: N Balachandran <nbalacha@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-rebalance.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
index 941e982b362..ae367d75e27 100644
--- a/xlators/cluster/dht/src/dht-rebalance.c
+++ b/xlators/cluster/dht/src/dht-rebalance.c
@@ -163,6 +163,14 @@ dht_send_rebalance_event (xlator_t *this, int cmd, gf_defrag_status_t status)
}
+static void
+dht_strip_out_acls (dict_t *dict)
+{
+ if (dict) {
+ dict_del (dict, "trusted.SGI_ACL_FILE");
+ dict_del (dict, "POSIX_ACL_ACCESS_XATTR");
+ }
+}
@@ -1624,6 +1632,9 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
loc->path, from->name);
}
+ /* Copying posix acls to the linkto file messes up the permissions*/
+ dht_strip_out_acls (xattr);
+
/* create the destination, with required modes/xattr */
ret = __dht_rebalance_create_dst_file (this, to, from, loc, &stbuf,
&dst_fd, xattr, fop_errno);