Skip to content

Commit

Permalink
Btrfs: prohibit a operation of changing acl's mask when noacl mount o…
Browse files Browse the repository at this point in the history
…ption used

when used Posix File System Test Suite(pjd-fstest) to test btrfs,
some cases about setfacl failed when noacl mount option used.
I simplified used commands in pjd-fstest, and the following steps
can reproduce it.
------------------------
# cd btrfs-part/
# mkdir aaa
# setfacl -m m::rw aaa    <- successed, but not expected by pjd-fstest.
------------------------
I checked ext3, a warning message occured, like as:
  setfacl: aaa/: Operation not supported
Certainly, it's expected by pjd-fstest.

So, i compared acl.c of btrfs and ext3. Based on that, a patch created.
Fortunately, it works.

Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Shi Weihua authored and Chris Mason committed Jun 11, 2010
1 parent 2f26afb commit 731e3d1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/btrfs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name,
if (!is_owner_or_cap(dentry->d_inode))
return -EPERM;

if (!IS_POSIXACL(dentry->d_inode))
return -EOPNOTSUPP;

if (value) {
acl = posix_acl_from_xattr(value, size);
if (acl == NULL) {
Expand Down

0 comments on commit 731e3d1

Please sign in to comment.