summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/upcall/src/upcall.c9
-rw-r--r--xlators/performance/md-cache/src/md-cache.c5
2 files changed, 13 insertions, 1 deletions
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);
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index be42bf0a885..8a381b18981 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -2402,7 +2402,10 @@ mdc_invalidate (xlator_t *this, void *data)
goto out;
}
if (up_ci->flags & UP_XATTR) {
- ret = mdc_inode_xatt_update (this, inode, up_ci->dict);
+ if (up_ci->dict)
+ ret = mdc_inode_xatt_update (this, inode, up_ci->dict);
+ else
+ ret = mdc_inode_xatt_invalidate (this, inode);
} else if (up_ci->flags & UP_XATTR_RM) {
tmp.inode = inode;
tmp.this = this;