]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: flush osr even on failure in _deferred_replay
authorSage Weil <sage@redhat.com>
Wed, 29 Mar 2017 22:33:12 +0000 (18:33 -0400)
committerSage Weil <sage@redhat.com>
Wed, 5 Apr 2017 14:23:38 +0000 (10:23 -0400)
This is one less thing for fsck to worry about.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc

index 248d32d5e766e3b9838b4491b8c7d2d2b93a627f..ca3a42805533b79c82085cc9d122e8d705c5c428 100644 (file)
@@ -8048,6 +8048,7 @@ int BlueStore::_deferred_replay()
   dout(10) << __func__ << " start" << dendl;
   OpSequencerRef osr = new OpSequencer(cct, this);
   int count = 0;
+  int r = 0;
   KeyValueDB::Iterator it = db->get_iterator(PREFIX_DEFERRED);
   for (it->lower_bound(string()); it->valid(); it->next(), ++count) {
     dout(20) << __func__ << " replay " << pretty_binary_string(it->key())
@@ -8062,18 +8063,20 @@ int BlueStore::_deferred_replay()
       derr << __func__ << " failed to decode deferred txn "
           << pretty_binary_string(it->key()) << dendl;
       delete deferred_txn;
-      return -EIO;
+      r = -EIO;
+      goto out;
     }
     TransContext *txc = _txc_create(osr.get());
     txc->deferred_txn = deferred_txn;
     txc->state = TransContext::STATE_KV_DONE;
     _txc_state_proc(txc);
   }
+ out:
   dout(20) << __func__ << " draining osr" << dendl;
   _osr_drain_all();
   osr->discard();
   dout(10) << __func__ << " completed " << count << " events" << dendl;
-  return 0;
+  return r;
 }
 
 // ---------------------------