From 6399f1d0608f3266b27df9a6f180bfaf473b8e7b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 28 Apr 2015 09:47:09 -0700 Subject: [PATCH] os/newstore: fix multiple aio case Signed-off-by: Sage Weil --- src/os/newstore/NewStore.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/os/newstore/NewStore.cc b/src/os/newstore/NewStore.cc index 3088f43027de5..39af9c45f05ce 100644 --- a/src/os/newstore/NewStore.cc +++ b/src/os/newstore/NewStore.cc @@ -2345,8 +2345,8 @@ void NewStore::_aio_thread() if (r == 1) { TransContext *txc = static_cast(aio->priv); int left = txc->num_aio.dec(); - dout(10) << __func__ << " finished aio on " << txc << " state " - << txc->get_state_name() << ", " + dout(10) << __func__ << " finished aio " << aio << " txc " << txc + << " state " << txc->get_state_name() << ", " << left << " aios left" << dendl; VOID_TEMP_FAILURE_RETRY(::close(aio->fd)); if (left == 0) { @@ -2685,14 +2685,14 @@ void NewStore::_txc_aio_submit(TransContext *txc) // be careful: as soon as we submit aio we race with completion. // since we are holding a ref take care not to dereference txc at // all after that point. - list::iterator next = p; - ++next; - done = (next == e); + list::iterator cur = p; + ++p; + done = (p == e); // do not dereference txc (or it's contents) after we submit (if // done == true and we don't loop) int retries = 0; - int r = aio_queue.submit(*p, &retries); + int r = aio_queue.submit(*cur, &retries); if (retries) derr << __func__ << " retries " << retries << dendl; if (r) { -- 2.39.5