Skip to content

Commit

Permalink
ext2,3,4: provide simple rcu-walk ACL implementation
Browse files Browse the repository at this point in the history
This simple implementation just checks for no ACLs on the inode, and
if so, then the rcu-walk may proceed, otherwise fail it.

Signed-off-by: Nick Piggin <npiggin@kernel.dk>
  • Loading branch information
Nick Piggin committed Jan 7, 2011
1 parent 1e1743e commit 7359861
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions fs/ext2/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,11 @@ ext2_check_acl(struct inode *inode, int mask, unsigned int flags)
{
struct posix_acl *acl;

if (flags & IPERM_FLAG_RCU)
return -ECHILD;
if (flags & IPERM_FLAG_RCU) {
if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
return -ECHILD;
return -EAGAIN;
}

acl = ext2_get_acl(inode, ACL_TYPE_ACCESS);
if (IS_ERR(acl))
Expand Down
7 changes: 5 additions & 2 deletions fs/ext3/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,11 @@ ext3_check_acl(struct inode *inode, int mask, unsigned int flags)
{
struct posix_acl *acl;

if (flags & IPERM_FLAG_RCU)
return -ECHILD;
if (flags & IPERM_FLAG_RCU) {
if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
return -ECHILD;
return -EAGAIN;
}

acl = ext3_get_acl(inode, ACL_TYPE_ACCESS);
if (IS_ERR(acl))
Expand Down
7 changes: 5 additions & 2 deletions fs/ext4/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,11 @@ ext4_check_acl(struct inode *inode, int mask, unsigned int flags)
{
struct posix_acl *acl;

if (flags & IPERM_FLAG_RCU)
return -ECHILD;
if (flags & IPERM_FLAG_RCU) {
if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
return -ECHILD;
return -EAGAIN;
}

acl = ext4_get_acl(inode, ACL_TYPE_ACCESS);
if (IS_ERR(acl))
Expand Down

0 comments on commit 7359861

Please sign in to comment.