From 5ae0a5d1e92175c28cd5470b890e99ff4eac0673 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Fri, 29 Jul 2016 12:20:11 +0530 Subject: md-cache/upcall: In case of mode bit change invalidate xattr When the mode bits are changed, the ACL entries also do get affected. Currently in upcall, setattr invalidates only the stat info. With this patch, if mode bits are changed, the upcall will invalidate all the xattrs. Change-Id: Iccda2e1a7440ee845aa5442bf51970f74d9b0862 BUG: 1211863 Signed-off-by: Poornima G Reviewed-on: http://review.gluster.org/15043 Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Niels de Vos NetBSD-regression: NetBSD Build System Reviewed-by: Prashanth Pai Reviewed-by: Jeff Darcy --- xlators/features/upcall/src/upcall.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators/features') diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c index 40cfb6c7f11..ea716214a56 100644 --- a/xlators/features/upcall/src/upcall.c +++ b/xlators/features/upcall/src/upcall.c @@ -333,6 +333,15 @@ up_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, * Bug1200271. */ flags = UP_ATTR_FLAGS; + /* If mode bits have changed invalidate the xattrs, as posix-acl and + * others store permission related information in xattrs. With changing + * of permissions/mode, we need to make clients to forget all the + * xattrs related to permissions. + * TODO: Invalidate the xattr system.posix_acl_access alone. + */ + if (is_same_mode(statpre->ia_prot, statpost->ia_prot) != 0) + flags |= UP_XATTR; + upcall_cache_invalidate (frame, this, client, local->inode, flags, statpost, NULL, NULL, NULL); -- cgit