[PATCH 1/2] xfs: Fixes to "invalidate cached acl if set directly via xattr"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs



[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux