staging: lustre: llite: allow cached acls
authorDmitry Eremin <dmitry.eremin@intel.com>
Wed, 26 Jul 2017 15:22:33 +0000 (11:22 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 30 Jul 2017 15:08:31 +0000 (08:08 -0700)
Move the freeing of all cached acls from ll_get_acl() to the
function ll_clear_inode(). This way we free all cached acls
for the inode just before clearing it. This allow us to take
advantage of cached acls and correctly free them before free.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-on: https://review.whamcloud.com/25965
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9183
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/file.c
drivers/staging/lustre/lustre/llite/llite_lib.c

index ab1c85c1ed3896b1d2da0b84f0674dfe633a3a02..215479a218657d429e36331ae5b1e5a01628f2ec 100644 (file)
@@ -3035,9 +3035,6 @@ struct posix_acl *ll_get_acl(struct inode *inode, int type)
        spin_lock(&lli->lli_lock);
        /* VFS' acl_permission_check->check_acl will release the refcount */
        acl = posix_acl_dup(lli->lli_posix_acl);
-#ifdef CONFIG_FS_POSIX_ACL
-       forget_cached_acl(inode, type);
-#endif
        spin_unlock(&lli->lli_lock);
 
        return acl;
index ba7d3b9f33a643389b807ba1f271b294a7316a09..5c8405c71e4b2123ec1ed0c400244a1e1788077b 100644 (file)
@@ -1316,6 +1316,7 @@ void ll_clear_inode(struct inode *inode)
        ll_xattr_cache_destroy(inode);
 
 #ifdef CONFIG_FS_POSIX_ACL
+       forget_all_cached_acls(inode);
        if (lli->lli_posix_acl) {
                posix_acl_release(lli->lli_posix_acl);
                lli->lli_posix_acl = NULL;