@@ -158,7 +158,14 @@ int ceph_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
goto out_free;
}
- ceph_set_cached_acl(inode, type, acl);
+ /*
+ * If the attribute didn't exist to start with that's fine.
+ */
+ if (!acl && ret == -ENODATA)
+ ret = 0;
+
+ if (!ret)
+ ceph_set_cached_acl(inode, type, acl);
out_free:
kfree(value);
@@ -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;
}
}