diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-24 17:02:42 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-24 17:02:42 -0400 |
commit | d5bb68adda7cc179e8efadeaa3a283cb470f13a6 (patch) | |
tree | bb50b072ba652699553b6a20dc00de4e951623cc /fs/jfs | |
parent | 72c04902d1e27c8a324014cff1d4475c11b1cecd (diff) |
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.c | 13 |
1 files changed, 7 insertions, 6 deletions
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 @@ out: | |||
118 | 118 | ||
119 | static int jfs_check_acl(struct inode *inode, int mask) | 119 | static int jfs_check_acl(struct inode *inode, int mask) |
120 | { | 120 | { |
121 | if (inode->i_acl == ACL_NOT_CACHED) { | 121 | struct posix_acl *acl = jfs_get_acl(inode, ACL_TYPE_ACCESS); |
122 | struct posix_acl *acl = jfs_get_acl(inode, ACL_TYPE_ACCESS); | 122 | |
123 | if (IS_ERR(acl)) | 123 | if (IS_ERR(acl)) |
124 | return PTR_ERR(acl); | 124 | return PTR_ERR(acl); |
125 | if (acl) { | ||
126 | int error = posix_acl_permission(inode, acl, mask); | ||
125 | posix_acl_release(acl); | 127 | posix_acl_release(acl); |
128 | return error; | ||
126 | } | 129 | } |
127 | 130 | ||
128 | if (inode->i_acl) | ||
129 | return posix_acl_permission(inode, inode->i_acl, mask); | ||
130 | return -EAGAIN; | 131 | return -EAGAIN; |
131 | } | 132 | } |
132 | 133 | ||