Skip to content

Commit 7359861

Browse files
author
Nick Piggin
committed
ext2,3,4: provide simple rcu-walk ACL implementation
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>
1 parent 1e1743e commit 7359861

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

fs/ext2/acl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,11 @@ ext2_check_acl(struct inode *inode, int mask, unsigned int flags)
236236
{
237237
struct posix_acl *acl;
238238

239-
if (flags & IPERM_FLAG_RCU)
240-
return -ECHILD;
239+
if (flags & IPERM_FLAG_RCU) {
240+
if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
241+
return -ECHILD;
242+
return -EAGAIN;
243+
}
241244

242245
acl = ext2_get_acl(inode, ACL_TYPE_ACCESS);
243246
if (IS_ERR(acl))

fs/ext3/acl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,11 @@ ext3_check_acl(struct inode *inode, int mask, unsigned int flags)
244244
{
245245
struct posix_acl *acl;
246246

247-
if (flags & IPERM_FLAG_RCU)
248-
return -ECHILD;
247+
if (flags & IPERM_FLAG_RCU) {
248+
if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
249+
return -ECHILD;
250+
return -EAGAIN;
251+
}
249252

250253
acl = ext3_get_acl(inode, ACL_TYPE_ACCESS);
251254
if (IS_ERR(acl))

fs/ext4/acl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,11 @@ ext4_check_acl(struct inode *inode, int mask, unsigned int flags)
242242
{
243243
struct posix_acl *acl;
244244

245-
if (flags & IPERM_FLAG_RCU)
246-
return -ECHILD;
245+
if (flags & IPERM_FLAG_RCU) {
246+
if (!negative_cached_acl(inode, ACL_TYPE_ACCESS))
247+
return -ECHILD;
248+
return -EAGAIN;
249+
}
247250

248251
acl = ext4_get_acl(inode, ACL_TYPE_ACCESS);
249252
if (IS_ERR(acl))

0 commit comments

Comments
 (0)