From: Andreas Gruenbacher <agruenba@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Brian Foster <bfoster@redhat.com>,
Andreas Gruenbacher <agruenba@kernel.org>,
Andreas Gruenbacher <agruenba@redhat.com>,
xfs@oss.sgi.com
Subject: [PATCH 1/2] xfs: Fixes to "invalidate cached acl if set directly via xattr"
Date: Mon, 2 Nov 2015 20:52:53 +0100 [thread overview]
Message-ID: <1446493974-24669-2-git-send-email-agruenba@redhat.com> (raw)
In-Reply-To: <1446493974-24669-1-git-send-email-agruenba@redhat.com>
In-Reply-To: <20151102025352.GY19199@dastard>
Don't match arbitrary name prefixes like "S" when checking for the
attribute names "SGI_ACL_{FILE,DEFAULT}".
Function forget_cached_acl only exists in kernels that have POSIX ACL
support; guard calls to that function by CONFIG_XFS_POSIX_ACL.
Signed-off-by: Andreas Gruenbacher <agruenba@kernel.org>
---
fs/xfs/xfs_xattr.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
index 2e1eb80..1542d64 100644
--- a/fs/xfs/xfs_xattr.c
+++ b/fs/xfs/xfs_xattr.c
@@ -80,10 +80,12 @@ xfs_xattr_set(struct dentry *dentry, const char *name, const void *value,
* consistent.
*/
if (!error && (xflags & ATTR_ROOT)) {
- if (!strncmp(name, SGI_ACL_FILE, strlen(name)))
+#ifdef CONFIG_XFS_POSIX_ACL
+ if (!strcmp(name, SGI_ACL_FILE)
forget_cached_acl(VFS_I(ip), ACL_TYPE_ACCESS);
- else if (!strncmp(name, SGI_ACL_DEFAULT, strlen(name)))
+ else if (!strcmp(name, SGI_ACL_DEFAULT))
forget_cached_acl(VFS_I(ip), ACL_TYPE_DEFAULT);
+#endif
}
return error;
--
2.5.0
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-11-02 19:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 15:05 [PATCH v2 0/5] xfs: SGI ACL Fixes Andreas Gruenbacher
2015-10-30 15:05 ` [PATCH v2 1/5] xfs: Validate the length of on-disk ACLs Andreas Gruenbacher
2015-10-30 15:05 ` [PATCH v2 2/5] xfs: Plug memory leak in xfs_attrmulti_attr_set Andreas Gruenbacher
2015-10-30 15:05 ` [PATCH v2 3/5] xfs: SGI ACLs: Fix caching and mode setting Andreas Gruenbacher
2015-10-30 15:05 ` [PATCH v2 4/5] xfs: Add namespace parameter to the xfs kuid/kgid <=> uid/gid wrappers Andreas Gruenbacher
2015-10-30 15:05 ` [PATCH v2 5/5] xfs: SGI ACLs: Map uid/gid namespaces Andreas Gruenbacher
2015-11-02 2:53 ` [PATCH v2 0/5] xfs: SGI ACL Fixes Dave Chinner
2015-11-02 3:41 ` Andreas Gruenbacher
2015-11-02 12:20 ` Dave Chinner
2015-11-02 19:52 ` Andreas Gruenbacher
2015-11-02 19:52 ` Andreas Gruenbacher [this message]
2015-11-02 19:52 ` [PATCH 2/2] xfs: invalidate cached acl if set via ioctl Andreas Gruenbacher
2015-11-03 2:12 ` Dave Chinner
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=1446493974-24669-2-git-send-email-agruenba@redhat.com \
--to=agruenba@redhat.com \
--cc=agruenba@kernel.org \
--cc=bfoster@redhat.com \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/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