Skip to content

Commit

Permalink
another race fix in jfs_check_acl()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jun 24, 2009
1 parent 72c0490 commit d5bb68a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions fs/jfs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d5bb68a

Please sign in to comment.