From 7eda6fe62d4e47937afc2ba71b4fd858399bca05 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Mon, 28 Jan 2019 11:55:17 +0530 Subject: cluster/dht: Remove internal permission bits Rebalance sets the sgid and t bits on a file that is being migrated. These permissions are not removed in dht_readdirp_cbk when listing files causing them to show up on the mountpoint. We now remove these permissions if a non-linkto file has the linkto xattr set. Change-Id: I5c69b2ecfe2df804fe50faea903b242d01729596 fixes: bz#1669937 Signed-off-by: N Balachandran --- xlators/cluster/dht/src/dht-common.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xlators/cluster/dht') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 5ce1864007b..bc7214e1c7a 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -6764,6 +6764,12 @@ dht_readdirp_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, } } } else { + if (orig_entry->dict && + dict_get(orig_entry->dict, conf->link_xattr_name)) { + /* Strip out the S and T flags set by rebalance*/ + DHT_STRIP_PHASE1_FLAGS(&entry->d_stat); + } + if (orig_entry->inode) { ret = dht_layout_preset(this, prev, orig_entry->inode); if (ret) -- cgit