Always set up a negative ACL cache entry if the inode doesn't have an
attribute fork. That behaves much better than doing this check inside
->check_acl.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
int
xfs_check_acl(struct inode *inode, int mask)
{
- struct xfs_inode *ip;
struct posix_acl *acl;
int error = -EAGAIN;
- ip = XFS_I(inode);
- trace_xfs_check_acl(ip);
-
- /*
- * If there is no attribute fork no ACL exists on this inode and
- * we can skip the whole exercise.
- *
- * FIXME! Fill the cache! Locking?
- */
- if (!XFS_IFORK_Q(ip))
- return -EAGAIN;
+ trace_xfs_check_acl(XFS_I(inode));
acl = xfs_get_acl(inode, ACL_TYPE_ACCESS);
if (IS_ERR(acl))
break;
}
+ /* if there is no attribute fork no ACL can exist on this inode */
+ if (!XFS_IFORK_Q(ip))
+ cache_no_acl(inode);
+
xfs_iflags_clear(ip, XFS_INEW);
barrier();