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