diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2014-02-11 06:08:51 +0100 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2014-02-17 21:37:11 +0100 |
commit | 7a92d64760541e66bf5d1131f029b82773ce3922 (patch) | |
tree | cf836380fbeb42b5407aeaf42de47b81860cadde /fs/ceph | |
parent | ceph: fix ceph_removexattr() (diff) | |
download | linux-7a92d64760541e66bf5d1131f029b82773ce3922.tar.xz linux-7a92d64760541e66bf5d1131f029b82773ce3922.zip |
ceph: fix ceph_set_acl()
If acl is equivalent to file mode permission bits, ceph_set_acl()
needs to remove any existing acl xattr. Use __ceph_setxattr() to
handle both setting and removing acl xattr cases, it doesn't return
-ENODATA when there is no acl xattr.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/acl.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/ceph/acl.c b/fs/ceph/acl.c index 4c2d452c4bfc..accc9f28bc10 100644 --- a/fs/ceph/acl.c +++ b/fs/ceph/acl.c @@ -160,11 +160,7 @@ int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type) goto out_dput; } - if (value) - ret = __ceph_setxattr(dentry, name, value, size, 0); - else - ret = __ceph_removexattr(dentry, name); - + ret = __ceph_setxattr(dentry, name, value, size, 0); if (ret) { if (new_mode != old_mode) { newattrs.ia_mode = old_mode; |