e7a346
From 98bd66d16730964b2c6d14d5430e23dd16138193 Mon Sep 17 00:00:00 2001
e7a346
From: N Balachandran <nbalacha@redhat.com>
e7a346
Date: Wed, 22 Nov 2017 08:47:47 +0530
e7a346
Subject: [PATCH 081/128] cluster/dht: Don't set ACLs on linkto file
e7a346
e7a346
The trusted.SGI_ACL_FILE appears to set posix
e7a346
ACLs on the linkto file that is a target of
e7a346
file migration. This can mess up file permissions
e7a346
and cause linkto identification to fail.
e7a346
Now we remove all ACL xattrs from the results of
e7a346
the listxattr call on the source before setting them
e7a346
on the target.
e7a346
e7a346
> BUG: 1515042
e7a346
> https://review.gluster.org/#/c/18807/
e7a346
> Signed-off-by: N Balachandran <nbalacha@redhat.com>
e7a346
e7a346
Change-Id: I56802dbaed783a16e3fb90f59f4ce849f8a4a9b4
e7a346
BUG: 1515051
e7a346
Signed-off-by: N Balachandran <nbalacha@redhat.com>
e7a346
Reviewed-on: https://code.engineering.redhat.com/gerrit/123870
e7a346
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e7a346
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
e7a346
---
e7a346
 xlators/cluster/dht/src/dht-rebalance.c | 11 +++++++++++
e7a346
 1 file changed, 11 insertions(+)
e7a346
e7a346
diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c
e7a346
index 941e982..ae367d7 100644
e7a346
--- a/xlators/cluster/dht/src/dht-rebalance.c
e7a346
+++ b/xlators/cluster/dht/src/dht-rebalance.c
e7a346
@@ -163,6 +163,14 @@ dht_send_rebalance_event (xlator_t *this, int cmd, gf_defrag_status_t status)
e7a346
 }
e7a346
 
e7a346
 
e7a346
+static void
e7a346
+dht_strip_out_acls (dict_t *dict)
e7a346
+{
e7a346
+        if (dict) {
e7a346
+                dict_del (dict, "trusted.SGI_ACL_FILE");
e7a346
+                dict_del (dict, "POSIX_ACL_ACCESS_XATTR");
e7a346
+        }
e7a346
+}
e7a346
 
e7a346
 
e7a346
 
e7a346
@@ -1624,6 +1632,9 @@ dht_migrate_file (xlator_t *this, loc_t *loc, xlator_t *from, xlator_t *to,
e7a346
                         loc->path, from->name);
e7a346
         }
e7a346
 
e7a346
+        /* Copying posix acls to the linkto file messes up the permissions*/
e7a346
+        dht_strip_out_acls (xattr);
e7a346
+
e7a346
         /* create the destination, with required modes/xattr */
e7a346
         ret = __dht_rebalance_create_dst_file (this, to, from, loc, &stbuf,
e7a346
                                                &dst_fd, xattr, fop_errno);
e7a346
-- 
e7a346
1.8.3.1
e7a346