@@ -148,6 +148,11 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
}
ret = __ceph_setxattr(inode, name, value, size, 0);
+ /*
+ * If the attribute didn't exist to start with that's fine.
+ */
+ if (!acl && ret == -ENODATA)
+ ret = 0;
if (ret) {
if (new_mode != old_mode) {
newattrs.ia_ctime = old_ctime;
@@ -613,11 +613,10 @@ static int __set_xattr(struct ceph_inode_info *ci,
return err;
}
if (update_xattr < 0) {
- if (xattr)
- __remove_xattr(ci, xattr);
+ err = __remove_xattr(ci, xattr);
kfree(name);
kfree(*newxattr);
- return 0;
+ return err;
}
}
@@ -1131,7 +1130,7 @@ static int ceph_sync_setxattr(struct inode *inode, const char *name,
if (flags & CEPH_XATTR_REPLACE)
op = CEPH_MDS_OP_RMXATTR;
else
- flags |= CEPH_XATTR_REMOVE;
+ flags |= CEPH_XATTR_REMOVE | CEPH_XATTR_REMOVE2;
}
doutc(cl, "name %s value size %zu\n", name, size);
@@ -383,6 +383,7 @@ extern const char *ceph_mds_op_name(int op);
*/
#define CEPH_XATTR_CREATE (1 << 0)
#define CEPH_XATTR_REPLACE (1 << 1)
+#define CEPH_XATTR_REMOVE2 (1 << 30)
#define CEPH_XATTR_REMOVE (1 << 31)
/*