From: Christoph Hellwig <hch@lst.de>
To: Al Viro <viro@ZenIV.linux.org.uk>,
Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: [PATCH 2/4] xfs: cache negative ACLs if there is no attribute fork
Date: Sat, 23 Jul 2011 17:36:50 +0200 [thread overview]
Message-ID: <20110723153650.GB10887@lst.de> (raw)
In-Reply-To: <20110723153621.GA10832@lst.de>
Always set up a negative ACL cache entry if the inode doesn't have an
attribute fork. That behaves much better than doing this check inside
->check_acl.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/xfs/linux-2.6/xfs_acl.c
===================================================================
--- linux-2.6.orig/fs/xfs/linux-2.6/xfs_acl.c 2011-07-23 15:53:07.267433023 +0200
+++ linux-2.6/fs/xfs/linux-2.6/xfs_acl.c 2011-07-23 15:54:03.474099354 +0200
@@ -221,21 +221,10 @@ xfs_set_acl(struct inode *inode, int typ
int
xfs_check_acl(struct inode *inode, int mask)
{
- struct xfs_inode *ip;
struct posix_acl *acl;
int error = -EAGAIN;
- ip = XFS_I(inode);
- trace_xfs_check_acl(ip);
-
- /*
- * If there is no attribute fork no ACL exists on this inode and
- * we can skip the whole exercise.
- *
- * FIXME! Fill the cache! Locking?
- */
- if (!XFS_IFORK_Q(ip))
- return -EAGAIN;
+ trace_xfs_check_acl(XFS_I(inode));
acl = xfs_get_acl(inode, ACL_TYPE_ACCESS);
if (IS_ERR(acl))
Index: linux-2.6/fs/xfs/linux-2.6/xfs_iops.c
===================================================================
--- linux-2.6.orig/fs/xfs/linux-2.6/xfs_iops.c 2011-07-23 15:54:59.134099020 +0200
+++ linux-2.6/fs/xfs/linux-2.6/xfs_iops.c 2011-07-23 15:56:58.634098306 +0200
@@ -1194,6 +1194,10 @@ xfs_setup_inode(
break;
}
+ /* if there is no attribute fork no ACL can exist on this inode */
+ if (!XFS_IFORK_Q(ip))
+ cache_no_acl(inode);
+
xfs_iflags_clear(ip, XFS_INEW);
barrier();
next prev parent reply other threads:[~2011-07-23 15:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-23 15:36 [PATCH 0/4] more ACL updates Christoph Hellwig
2011-07-23 15:36 ` [PATCH 1/4] 9p: do no return 0 from ->check_acl without actually checking Christoph Hellwig
2011-07-23 15:49 ` Al Viro
2011-07-25 6:40 ` Aneesh Kumar K.V
2011-07-23 15:36 ` Christoph Hellwig [this message]
2011-07-23 15:37 ` [PATCH 3/4] reiserfs: cache negative ACLs for v1 stat format Christoph Hellwig
2011-07-23 15:37 ` [PATCH 4/4] fs: take the ACL checks to common code Christoph Hellwig
2011-07-23 15:56 ` Linus Torvalds
2011-07-23 16:00 ` Christoph Hellwig
2011-07-23 16:15 ` Al Viro
2011-07-24 13:07 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110723153650.GB10887@lst.de \
--to=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).