diff options
author | Joao Eduardo Luis <jecluis@gmail.com> | 2012-04-27 00:31:55 +0100 |
---|---|---|
committer | Sage Weil <sage.weil@dreamhost.com> | 2012-04-26 16:36:03 -0700 |
commit | 6910d83897fda5ad2d4dc1d4ce405a6ec95ee4e1 (patch) | |
tree | 28ca7c9db24407482546cb7505e4ca532ea8ac7d | |
parent | ead5d2a8138552ff4745a409d893471950a806da (diff) | |
download | ceph-6910d83897fda5ad2d4dc1d4ce405a6ec95ee4e1.tar.gz |
filestore: fix a journal replay issue with collection_add()
Signed-off-by: Joao Eduardo Luis <jecluis@gmail.com>
-rw-r--r-- | src/os/FileStore.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 3611e5befaf..8c11d6b8647 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -4599,6 +4599,14 @@ int FileStore::_collection_add(coll_t c, coll_t oldcid, const hobject_t& o, // open guard on object so we don't any previous operations on the // new name that will modify the source inode. int fd = lfn_open(oldcid, o, 0); + if (fd < 0) { + // the source collection/object does not exist. If we are replaying, we + // should be safe, so just return 0 and move on. + assert(replaying); + dout(10) << "collection_add " << c << "/" << o << " from " + << oldcid << "/" << o << " (dne, continue replay) " << dendl; + return 0; + } assert(fd >= 0); if (dstcmp > 0) { // if dstcmp == 0 the guard already says "in-progress" _set_replay_guard(fd, spos, true); |