Remove arbitrary #acl entries limits on ext[23] when writing This patch removes the arbitrary limit of 32 ACL entries on ext[23] when writing. With the path applied, the available space in the xattr block determines the effective number-of-entries limit. Even before this patch the xattr block could contain less space than required for the acl, so no additional error conditions are introduced. When kernels without the ext23-no-ace-read-limit.diff patch try to access a file with an acl that is too big, they will return ERANGE in the getxattr syscalls; access to the file will be denied. Big acls can still be replaced with `setfacl --set'. Andreas Gruenbacher , SUSE Labs Index: linux-2.6.2/fs/ext2/acl.c =================================================================== --- linux-2.6.2.orig/fs/ext2/acl.c +++ linux-2.6.2/fs/ext2/acl.c @@ -255,8 +255,6 @@ ext2_set_acl(struct inode *inode, int ty return -EINVAL; } if (acl) { - if (acl->a_count > EXT2_ACL_MAX_ENTRIES) - return -EINVAL; value = ext2_acl_to_disk(acl, &size); if (IS_ERR(value)) return (int)PTR_ERR(value); Index: linux-2.6.2/fs/ext2/acl.h =================================================================== --- linux-2.6.2.orig/fs/ext2/acl.h +++ linux-2.6.2/fs/ext2/acl.h @@ -7,7 +7,6 @@ #include #define EXT2_ACL_VERSION 0x0001 -#define EXT2_ACL_MAX_ENTRIES 32 typedef struct { __u16 e_tag; Index: linux-2.6.2/fs/ext3/acl.c =================================================================== --- linux-2.6.2.orig/fs/ext3/acl.c +++ linux-2.6.2/fs/ext3/acl.c @@ -259,8 +259,6 @@ ext3_set_acl(handle_t *handle, struct in return -EINVAL; } if (acl) { - if (acl->a_count > EXT3_ACL_MAX_ENTRIES) - return -EINVAL; value = ext3_acl_to_disk(acl, &size); if (IS_ERR(value)) return (int)PTR_ERR(value); Index: linux-2.6.2/fs/ext3/acl.h =================================================================== --- linux-2.6.2.orig/fs/ext3/acl.h +++ linux-2.6.2/fs/ext3/acl.h @@ -7,7 +7,6 @@ #include #define EXT3_ACL_VERSION 0x0001 -#define EXT3_ACL_MAX_ENTRIES 32 typedef struct { __u16 e_tag;