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