diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-11 17:18:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-06-11 17:18:47 -0400 |
commit | b25b550bb153626df6a48eb8583e923e3dfcf64a (patch) | |
tree | baca9843877b8b3a254cde92ac2a9072014b5621 /fs/btrfs/acl.c | |
parent | eda054770e5cd0e9ee1568dfcbcf39f9ade4f545 (diff) | |
parent | 6f902af400b2499c80865c62a06fbbd15cf804fd (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
Btrfs: The file argument for fsync() is never null
Btrfs: handle ERR_PTR from posix_acl_from_xattr()
Btrfs: avoid BUG when dropping root and reference in same transaction
Btrfs: prohibit a operation of changing acl's mask when noacl mount option used
Btrfs: should add a permission check for setfacl
Btrfs: btrfs_lookup_dir_item() can return ERR_PTR
Btrfs: btrfs_read_fs_root_no_name() returns ERR_PTRs
Btrfs: unwind after btrfs_start_transaction() errors
Btrfs: btrfs_iget() returns ERR_PTR
Btrfs: handle kzalloc() failure in open_ctree()
Btrfs: handle error returns from btrfs_lookup_dir_item()
Btrfs: Fix BUG_ON for fs converted from extN
Btrfs: Fix null dereference in relocation.c
Btrfs: fix remap_file_pages error
Btrfs: uninitialized data is check_path_shared()
Btrfs: fix fallocate regression
Btrfs: fix loop device on top of btrfs
Diffstat (limited to 'fs/btrfs/acl.c')
-rw-r--r-- | fs/btrfs/acl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 8d432cd9d580..2222d161c7b6 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
@@ -60,6 +60,8 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) | |||
60 | size = __btrfs_getxattr(inode, name, value, size); | 60 | size = __btrfs_getxattr(inode, name, value, size); |
61 | if (size > 0) { | 61 | if (size > 0) { |
62 | acl = posix_acl_from_xattr(value, size); | 62 | acl = posix_acl_from_xattr(value, size); |
63 | if (IS_ERR(acl)) | ||
64 | return acl; | ||
63 | set_cached_acl(inode, type, acl); | 65 | set_cached_acl(inode, type, acl); |
64 | } | 66 | } |
65 | kfree(value); | 67 | kfree(value); |
@@ -160,6 +162,12 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, | |||
160 | int ret; | 162 | int ret; |
161 | struct posix_acl *acl = NULL; | 163 | struct posix_acl *acl = NULL; |
162 | 164 | ||
165 | if (!is_owner_or_cap(dentry->d_inode)) | ||
166 | return -EPERM; | ||
167 | |||
168 | if (!IS_POSIXACL(dentry->d_inode)) | ||
169 | return -EOPNOTSUPP; | ||
170 | |||
163 | if (value) { | 171 | if (value) { |
164 | acl = posix_acl_from_xattr(value, size); | 172 | acl = posix_acl_from_xattr(value, size); |
165 | if (acl == NULL) { | 173 | if (acl == NULL) { |