diff options
| author | Shi Weihua <shiwh@cn.fujitsu.com> | 2010-05-17 20:51:54 -0400 |
|---|---|---|
| committer | Chris Mason <chris.mason@oracle.com> | 2010-06-11 15:57:38 -0400 |
| commit | 731e3d1b4348a96d53de6c084774424dedc64a3b (patch) | |
| tree | 1f0a95894fa9a8e226ee2d74c64805c373b1b927 | |
| parent | 2f26afba46f0ebf155cf9be746496a0304a5b7cf (diff) | |
Btrfs: prohibit a operation of changing acl's mask when noacl mount option 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>
| -rw-r--r-- | fs/btrfs/acl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 6b4d0cca5c7f..a372985b3a9a 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
| @@ -163,6 +163,9 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, | |||
| 163 | if (!is_owner_or_cap(dentry->d_inode)) | 163 | if (!is_owner_or_cap(dentry->d_inode)) |
| 164 | return -EPERM; | 164 | return -EPERM; |
| 165 | 165 | ||
| 166 | if (!IS_POSIXACL(dentry->d_inode)) | ||
| 167 | return -EOPNOTSUPP; | ||
| 168 | |||
| 166 | if (value) { | 169 | if (value) { |
| 167 | acl = posix_acl_from_xattr(value, size); | 170 | acl = posix_acl_from_xattr(value, size); |
| 168 | if (acl == NULL) { | 171 | if (acl == NULL) { |
