Re: Number of ACLs

Dave Chinner
2011-07-08T03:42:23Z

On Thu, Jul 07, 2011 at 02:44:10PM +0200, Laurent CARON wrote:
> Hi,
>
> I'd like to know if it is possible in a simple & safe way to
> increase the number of supported ACLs on an already existing FS.
>
> xfs_acl.h:
> #define XFS_ACL_MAX_ENTRIES 25
>
> Changing XFS_ACL_MAX_ENTRIES to something higher should do the
> trick, but will it be safe: ie: will I risk corrupting the FS this
> way ?

It's effectively an on-disk format change. If you add more than 25
ACLs and then downgrade kernel, you won't be able to access those
ACLs.

Hmmm, even worse, looking at the code it would probably cause a
buffer overrun (memory corupting crash) as the old kernels only
allocate an array large enough to hold 25 ACLs and the
xfs_acl_from_disk() function implicitly trusts the number of ACLs in
the xattr fits into the array....

So, that definitely means larger number of ACLs requires a feature
bit in the superblock so that once you go over 25 ACLs you can't use
that filesystem on a kernel that does not support >25 ACLs. i.e.
it's a typical on-disk versioning change that requires a bunch of
work in both kernel and userspace to support a new feature
superblock feature bit. In this case, the feature bit would
only need to be set by the kernel on existing filesystems when you
first go over 25 ACLs on an inode, so most people wouldn't even care
about the change....

An example for this dynamic setting of a feature bit is the code to
dynamically indicate the filesystem has version 2 inodes in it. See
xfs_bump_ino_vers2() and what it does to add a feature bit when that
transition occurs...

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com