static int fuse_setattr(struct dentry *entry, struct iattr *attr)
{
+ int ret;
+
if (attr->ia_valid & ATTR_FILE)
- return fuse_do_setattr(entry, attr, attr->ia_file);
+ ret = fuse_do_setattr(entry, attr, attr->ia_file);
else
- return fuse_do_setattr(entry, attr, NULL);
+ ret = fuse_do_setattr(entry, attr, NULL);
+
+ if (!ret) {
+ /* Directory mode changed, may need to revalidate access */
+ if (S_ISDIR(entry->d_inode->i_mode) &&
+ (attr->ia_valid & ATTR_MODE))
+ fuse_invalidate_entry_cache(entry);
+ }
+ return ret;
}
static int fuse_getattr(struct vfsmount *mnt, struct dentry *entry,