Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

jfs: cache NULL when both default_acl and acl are NULL

default_acl and acl of newly created inode will be initiated
as ACL_NOT_CACHED in vfs function inode_init_always() and later
will be updated by calling xxx_init_acl() in specific filesystems.
Howerver, when default_acl and acl are NULL then they keep the value
of ACL_NOT_CACHED, this patch tries to cache NULL for acl/default_acl
in this case.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

authored by

Chengguang Xu and committed by
Dave Kleikamp
e8d4ceeb be65e259

+4
+4
fs/jfs/acl.c
··· 146 146 if (default_acl) { 147 147 rc = __jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, default_acl); 148 148 posix_acl_release(default_acl); 149 + } else { 150 + inode->i_default_acl = NULL; 149 151 } 150 152 151 153 if (acl) { 152 154 if (!rc) 153 155 rc = __jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl); 154 156 posix_acl_release(acl); 157 + } else { 158 + inode->i_acl = NULL; 155 159 } 156 160 157 161 JFS_IP(inode)->mode2 = (JFS_IP(inode)->mode2 & 0xffff0000) |