From 481c3c71c428c31ac84e2e1acf21b0ae07e4e32d Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Tue, 4 Jun 2019 14:51:44 +0530 Subject: 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. Backport of: > Change-Id: I8b4239ffee7001493c59d4032a2d3062586ea115 > fixes: bz#1716830 > Signed-off-by: N Balachandran Change-Id: I8b4239ffee7001493c59d4032a2d3062586ea115 fixes: bz#1716848 Signed-off-by: N Balachandran --- xlators/cluster/dht/src/dht-common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index a052d826408..ad06d89cc30 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -1738,9 +1738,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; -- cgit