summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2019-06-04 14:51:44 +0530
committerAmar Tumballi <amarts@redhat.com>2019-06-05 07:20:15 +0000
commit3949d241e8504b1c5226d0e6f6e06a2a12d8357c (patch)
tree21368ab30a455211f5afff465b88839528b3f207 /xlators/cluster/dht
parente7aeab3063ac5645136303278b477d7de35266c0 (diff)
cluster/dht: Fix directory perms during selfheal
Fixed a bug in the revalidate code path that wiped out directory permissions if no mds subvol was found. Change-Id: I8b4239ffee7001493c59d4032a2d3062586ea115 fixes: bz#1716830 Signed-off-by: N Balachandran <nbalacha@redhat.com>
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r--xlators/cluster/dht/src/dht-common.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 183872f28d8..e1edb380204 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -1739,9 +1739,11 @@ unlock:
if (dht_needs_selfheal(frame, this)) {
if (!__is_root_gfid(local->loc.inode->gfid)) {
- local->stbuf.ia_gid = local->mds_stbuf.ia_gid;
- local->stbuf.ia_uid = local->mds_stbuf.ia_uid;
- local->stbuf.ia_prot = local->mds_stbuf.ia_prot;
+ if (local->mds_subvol) {
+ local->stbuf.ia_gid = local->mds_stbuf.ia_gid;
+ local->stbuf.ia_uid = local->mds_stbuf.ia_uid;
+ local->stbuf.ia_prot = local->mds_stbuf.ia_prot;
+ }
} else {
local->stbuf.ia_gid = local->prebuf.ia_gid;
local->stbuf.ia_uid = local->prebuf.ia_uid;