e3c68b
From 6198461bce7d264b71fe91e981aa3af3a19a8abe Mon Sep 17 00:00:00 2001
e3c68b
From: N Balachandran <nbalacha@redhat.com>
e3c68b
Date: Tue, 4 Jun 2019 14:51:44 +0530
e3c68b
Subject: [PATCH 168/169] cluster/dht: Fix directory perms during selfheal
e3c68b
e3c68b
Fixed a bug in the revalidate code path that wiped out
e3c68b
directory permissions if no mds subvol was found.
e3c68b
e3c68b
upstream: https://review.gluster.org/#/c/glusterfs/+/22813/
e3c68b
e3c68b
> Change-Id: I8b4239ffee7001493c59d4032a2d3062586ea115
e3c68b
> fixes: bz#1716830
e3c68b
> Signed-off-by: N Balachandran <nbalacha@redhat.com>
e3c68b
e3c68b
BUG: 1716821
e3c68b
Change-Id: I6d84d381d07a27d1ef9113a2104a62ceaf2110e3
e3c68b
Signed-off-by: N Balachandran <nbalacha@redhat.com>
e3c68b
Reviewed-on: https://code.engineering.redhat.com/gerrit/172622
e3c68b
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e3c68b
Reviewed-by: Mohit Agrawal <moagrawa@redhat.com>
e3c68b
---
e3c68b
 xlators/cluster/dht/src/dht-common.c | 8 +++++---
e3c68b
 1 file changed, 5 insertions(+), 3 deletions(-)
e3c68b
e3c68b
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
e3c68b
index 183872f..e1edb38 100644
e3c68b
--- a/xlators/cluster/dht/src/dht-common.c
e3c68b
+++ b/xlators/cluster/dht/src/dht-common.c
e3c68b
@@ -1739,9 +1739,11 @@ unlock:
e3c68b
 
e3c68b
             if (dht_needs_selfheal(frame, this)) {
e3c68b
                 if (!__is_root_gfid(local->loc.inode->gfid)) {
e3c68b
-                    local->stbuf.ia_gid = local->mds_stbuf.ia_gid;
e3c68b
-                    local->stbuf.ia_uid = local->mds_stbuf.ia_uid;
e3c68b
-                    local->stbuf.ia_prot = local->mds_stbuf.ia_prot;
e3c68b
+                    if (local->mds_subvol) {
e3c68b
+                        local->stbuf.ia_gid = local->mds_stbuf.ia_gid;
e3c68b
+                        local->stbuf.ia_uid = local->mds_stbuf.ia_uid;
e3c68b
+                        local->stbuf.ia_prot = local->mds_stbuf.ia_prot;
e3c68b
+                    }
e3c68b
                 } else {
e3c68b
                     local->stbuf.ia_gid = local->prebuf.ia_gid;
e3c68b
                     local->stbuf.ia_uid = local->prebuf.ia_uid;
e3c68b
-- 
e3c68b
1.8.3.1
e3c68b