]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: bubble journal error up via existing AioObjectRequests
authorJason Dillaman <dillaman@redhat.com>
Mon, 9 May 2016 21:59:09 +0000 (17:59 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 9 Jun 2016 18:08:44 +0000 (14:08 -0400)
The journal cannot directly fail the AioCompletion because it
might have one-or-more outstanding requests associated with
it.

Fixes: http://tracker.ceph.com/issues/15791
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 79c934742fb15c803780519b36070408599a74c5)

src/librbd/Journal.cc

index ffdfe1d40da7509676ae750605ecdef1fd3aece6..ebd1f246eef0c641c55b9bd6942ad2a74b3b7cee 100644 (file)
@@ -1477,7 +1477,6 @@ void Journal<I>::handle_io_event_safe(int r, uint64_t tid) {
     lderr(cct) << "failed to commit IO event: "  << cpp_strerror(r) << dendl;
   }
 
-  AioCompletion *aio_comp;
   AioObjectRequests aio_object_requests;
   Contexts on_safe_contexts;
   {
@@ -1486,7 +1485,6 @@ void Journal<I>::handle_io_event_safe(int r, uint64_t tid) {
     assert(it != m_events.end());
 
     Event &event = it->second;
-    aio_comp = event.aio_comp;
     aio_object_requests.swap(event.aio_object_requests);
     on_safe_contexts.swap(event.on_safe_contexts);
 
@@ -1507,15 +1505,14 @@ void Journal<I>::handle_io_event_safe(int r, uint64_t tid) {
   }
 
   ldout(cct, 20) << "completing tid=" << tid << dendl;
-
-  if (r < 0) {
-    // don't send aio requests if the journal fails -- bubble error up
-    aio_comp->fail(cct, r);
-  } else {
-    // send any waiting aio requests now that journal entry is safe
-    RWLock::RLocker owner_locker(m_image_ctx.owner_lock);
-    for (AioObjectRequests::iterator it = aio_object_requests.begin();
-         it != aio_object_requests.end(); ++it) {
+  for (AioObjectRequests::iterator it = aio_object_requests.begin();
+       it != aio_object_requests.end(); ++it) {
+    if (r < 0) {
+      // don't send aio requests if the journal fails -- bubble error up
+      (*it)->complete(r);
+    } else {
+      // send any waiting aio requests now that journal entry is safe
+      RWLock::RLocker owner_locker(m_image_ctx.owner_lock);
       (*it)->send();
     }
   }