From 622d22e2d4654cd9e85838e5249af17128f23b67 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 24 Aug 2015 11:00:13 -0400 Subject: [PATCH] osd: wait for cleanup from bench We need to wait for cleanup to flush before we destroy the sequencer or else we get a use-after-free. Introduced e7bbafa3bfbd5e936a8be026a30b83a89f6121c3. Fixes: #12766 Signed-off-by: Sage Weil --- src/osd/OSD.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index f8660c07c7635..87c47bc25d436 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -5162,6 +5162,12 @@ void OSD::do_command(Connection *con, ceph_tid_t tid, vector& cmd, buffe // clean up store->queue_transaction_and_cleanup(osr.get(), cleanupt); + { + C_SaferCond waiter; + if (!osr->flush_commit(&waiter)) { + waiter.wait(); + } + } uint64_t rate = (double)count / (end - start); if (f) { -- 2.39.5