Skip to content

Commit

Permalink
ceph: fix ceph_set_acl()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yan, Zheng authored and Sage Weil committed Feb 17, 2014
1 parent 524186a commit 7a92d64
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/ceph/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7a92d64

Please sign in to comment.