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