X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=fs%2Fceph%2Facl.c;h=987044bca1c27176ab4d6fca34e5787ae3f9404c;hb=e3300ffef0653774f1099cab153d25d24bd773ce;hp=4f67227f69a5aab225ebc651fd03f5d3f7cb3069;hpb=1a946005b348fe4fbea9edfd02bc27b33752c08d;p=cascardo%2Flinux.git diff --git a/fs/ceph/acl.c b/fs/ceph/acl.c index 4f67227f69a5..987044bca1c2 100644 --- a/fs/ceph/acl.c +++ b/fs/ceph/acl.c @@ -95,11 +95,9 @@ int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type) case ACL_TYPE_ACCESS: name = XATTR_NAME_POSIX_ACL_ACCESS; if (acl) { - ret = posix_acl_equiv_mode(acl, &new_mode); - if (ret < 0) + ret = posix_acl_update_mode(inode, &new_mode, &acl); + if (ret) goto out; - if (ret == 0) - acl = NULL; } break; case ACL_TYPE_DEFAULT: @@ -127,6 +125,11 @@ int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type) goto out_free; } + if (ceph_snap(inode) != CEPH_NOSNAP) { + ret = -EROFS; + goto out_free; + } + if (new_mode != old_mode) { newattrs.ia_mode = new_mode; newattrs.ia_valid = ATTR_MODE;