From: Al Viro Date: Wed, 24 Jun 2009 21:02:42 +0000 (-0400) Subject: another race fix in jfs_check_acl() X-Git-Tag: v2.6.31-rc1~3^2 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=d5bb68adda7cc179e8efadeaa3a283cb470f13a6;p=linux.git another race fix in jfs_check_acl() Signed-off-by: Al Viro --- diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index f272bf032e1e..91fa3ad6e8c2 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c @@ -118,15 +118,16 @@ static int jfs_set_acl(tid_t tid, struct inode *inode, int type, static int jfs_check_acl(struct inode *inode, int mask) { - if (inode->i_acl == ACL_NOT_CACHED) { - struct posix_acl *acl = jfs_get_acl(inode, ACL_TYPE_ACCESS); - if (IS_ERR(acl)) - return PTR_ERR(acl); + struct posix_acl *acl = jfs_get_acl(inode, ACL_TYPE_ACCESS); + + if (IS_ERR(acl)) + return PTR_ERR(acl); + if (acl) { + int error = posix_acl_permission(inode, acl, mask); posix_acl_release(acl); + return error; } - if (inode->i_acl) - return posix_acl_permission(inode, inode->i_acl, mask); return -EAGAIN; }