]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Journaler: do not call onsafe->complete() if onsafe is 0 37229/head
authorXiubo Li <xiubli@redhat.com>
Tue, 25 Aug 2020 04:33:48 +0000 (00:33 -0400)
committerVicente Cheng <freeze.bilsted@gmail.com>
Fri, 18 Sep 2020 10:50:48 +0000 (10:50 +0000)
Fixes: https://tracker.ceph.com/issues/47125
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit f923f9572a4f5fe1dff3ac3af3c4cb2cb2035113)

src/osdc/Journaler.cc

index a26d3e96029b5c5e1abbb14247b1cd342fc80648..5c00293e6645eb2cc16982a42361a772a4573ea9 100644 (file)
@@ -704,7 +704,8 @@ void Journaler::wait_for_flush(Context *onsafe)
 {
   lock_guard l(lock);
   if (is_stopping()) {
-    onsafe->complete(-EAGAIN);
+    if (onsafe)
+      onsafe->complete(-EAGAIN);
     return;
   }
   _wait_for_flush(onsafe);
@@ -737,7 +738,8 @@ void Journaler::flush(Context *onsafe)
 {
   lock_guard l(lock);
   if (is_stopping()) {
-    onsafe->complete(-EAGAIN);
+    if (onsafe)
+      onsafe->complete(-EAGAIN);
     return;
   }
   _flush(wrap_finisher(onsafe));