]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Fix removexattr ENODATA error
authorSam Lang <sam.lang@inktank.com>
Mon, 8 Oct 2012 17:04:57 +0000 (12:04 -0500)
committerSage Weil <sage@inktank.com>
Tue, 9 Oct 2012 03:55:03 +0000 (20:55 -0700)
If a client sets an xattr and then attempts to remove in a short
time window, the xattr may not have been committed to the journal
and will only be set on the projected xattrs of the inode.  This
results in a removexattr returning ENODATA at present.  The fix
here checks the xattr name in the projected xattrs, and only
returns ENODATA in the case where the name doesn't exist in that
map either.

Signed-off-by: Sam Lang <sam.lang@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/mds/Server.cc

index f504f29aebd4f1940ae64f899064b21ee22ae8da..0b133136fe774a6189d5b633a5bbc3d49526625e 100644 (file)
@@ -3454,7 +3454,9 @@ void Server::handle_client_removexattr(MDRequest *mdr)
     return;
 
   string name(req->get_path2());
-  if (cur->xattrs.count(name) == 0) {
+
+  map<string, bufferptr> *pxattrs = cur->get_projected_xattrs();
+  if (pxattrs->count(name) == 0) {
     dout(10) << "removexattr '" << name << "' and ENODATA on " << *cur << dendl;
     reply_request(mdr, -ENODATA);
     return;