@@ -155,6 +155,12 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
__ceph_setattr(idmap, inode, &newattrs, NULL);
}
+
+ /*
+ * If the attribute didn't exist to start with that's fine.
+ */
+ if (!acl && ret == -ENODATA)
+ ret = 0;
goto out_free;
}
@@ -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)
/*