public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Laurent CARON <lcaron@lncsa.com>
Cc: xfs@oss.sgi.com
Subject: Re: Number of ACLs
Date: Fri, 8 Jul 2011 13:42:18 +1000	[thread overview]
Message-ID: <20110708034218.GG1026@dastard> (raw)
In-Reply-To: <4E15AA1A.3090802@lncsa.com>

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

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      parent reply	other threads:[~2011-07-08  3:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 12:44 Number of ACLs Laurent CARON
2011-07-07 13:20 ` Emmanuel Florac
2011-07-07 13:26 ` Emmanuel Florac
2011-07-07 16:20   ` Laurent CARON
2011-07-08  3:42 ` Dave Chinner [this message]

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=20110708034218.GG1026@dastard \
    --to=david@fromorbit.com \
    --cc=lcaron@lncsa.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