]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
FileStore::_collection_move_rename: remove source before closing guard
authorSamuel Just <sam.just@inktank.com>
Sun, 8 Dec 2013 22:44:48 +0000 (14:44 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 22 Jan 2014 22:38:25 +0000 (14:38 -0800)
Fixes a bug in _collection_move_rename replays.

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

index a6656725e356184d4bfcfd1d00278e36ab6646dd..d18393c06ab73bded167a5056d827001f1826750 100644 (file)
@@ -4342,13 +4342,26 @@ int FileStore::_collection_move_rename(coll_t oldcid, const ghobject_t& oldoid,
 
     _inject_failure();
 
+    lfn_close(fd);
+    fd = FDRef();
+
+    if (r == 0)
+      r = lfn_unlink(oldcid, oldoid, spos, true);
+
+    if (r == 0)
+      r = lfn_open(c, o, 0, &fd);
+
     // close guard on object so we don't do this again
-    if (r == 0) {
+    if (r == 0)
       _close_replay_guard(**fd, spos);
-    }
+
     lfn_close(fd);
   }
 
+  dout(10) << __func__ << " " << c << "/" << o << " from " << oldcid << "/" << oldoid
+          << " = " << r << dendl;
+  return r;
+
  out_rm_src:
   // remove source
   if (_check_replay_guard(oldcid, oldoid, spos) > 0) {