summaryrefslogtreecommitdiffstats
path: root/fs/jfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-06-24 17:02:42 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-24 17:02:42 -0400
commitd5bb68adda7cc179e8efadeaa3a283cb470f13a6 (patch)
treebb50b072ba652699553b6a20dc00de4e951623cc /fs/jfs
parent72c04902d1e27c8a324014cff1d4475c11b1cecd (diff)
downloadop-kernel-dev-d5bb68adda7cc179e8efadeaa3a283cb470f13a6.zip
op-kernel-dev-d5bb68adda7cc179e8efadeaa3a283cb470f13a6.tar.gz
another race fix in jfs_check_acl()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/jfs')
-rw-r--r--fs/jfs/acl.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c
index f272bf0..91fa3ad 100644
--- a/fs/jfs/acl.c
+++ b/fs/jfs/acl.c
@@ -118,15 +118,16 @@ out:
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;
}
OpenPOWER on IntegriCloud