From 4536f7bdf16f8286d67598eda9a46c029f0c0bf4 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Tue, 8 Nov 2016 10:32:29 +0530 Subject: dht/md-cache: Filter invalidate if the file is made a linkto file Upcall as a part of setattr, sends an invalidation and the invalidation carries the resulting stat value. When a file is converted to linkto files, even then an invalidation is set and as a result the mountpoint shows the sticky bit in the stat of the file. eg: ---------T. 945 root root 0 Nov 8 10:14 hardlink.999 Fix: When dht recieves a notification of sticky bit change, it updates the flag, to indicate md-cache to send the subsequent lookup. Change-Id: Ic2fd7a5b196db0754f9b97072e644e6bf69da606 BUG: 1392713 Signed-off-by: Poornima G Reviewed-on: http://review.gluster.org/15789 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Niels de Vos CentOS-regression: Gluster Build System Reviewed-by: Susant Palai Reviewed-by: Rajesh Joseph --- xlators/cluster/dht/src/dht-common.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 4e3d7026c4a..af3b7a24838 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -9054,7 +9054,13 @@ unlock: * notify all the md-cache clients to invalidate the existing * stat cache and send the lookup next time*/ if (up_ci->dict && dict_get (up_ci->dict, conf->xattr_name)) - ret = dict_set_int8 (up_ci->dict, MDC_INVALIDATE_IATT , 0); + up_ci->flags |= UP_EXPLICIT_LOOKUP; + + /* TODO: Instead of invalidating iatt, update the new + * hashed/cached subvolume in dht inode_ctx */ + if (IS_DHT_LINKFILE_MODE (&up_ci->stat)) + up_ci->flags |= UP_EXPLICIT_LOOKUP; + propagate = 1; break; default: -- cgit