]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
FileStore::_collection_move_rename: propogate EEXIST
authorSamuel Just <sam.just@inktank.com>
Wed, 5 Mar 2014 20:50:43 +0000 (12:50 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 5 Mar 2014 20:52:49 +0000 (12:52 -0800)
Previously, an EEXIST would get masked by the subsequent clone
operation.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/os/FileStore.cc

index 43dea84e67bf25ccce138b3d7d8945e2a9edd45e..f6c51b345964229bb6dc0a109548ebaa3995986c 100644 (file)
@@ -4465,10 +4465,12 @@ int FileStore::_collection_move_rename(coll_t oldcid, const ghobject_t& oldoid,
 
     _inject_failure();
 
-    // the name changed; link the omap content
-    r = object_map->clone(oldoid, o, &spos);
-    if (r == -ENOENT)
-      r = 0;
+    if (r == 0) {
+      // the name changed; link the omap content
+      r = object_map->clone(oldoid, o, &spos);
+      if (r == -ENOENT)
+       r = 0;
+    }
 
     _inject_failure();