]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
MDS: add null check before we push_back "onfinish"
authorroot <tdd108128@163.com>
Sun, 12 Nov 2017 08:56:02 +0000 (16:56 +0800)
committerroot <tdd108128@163.com>
Sun, 12 Nov 2017 09:06:01 +0000 (17:06 +0800)
Fix: finish_context does not expect a null pointer, would cause crash.

Signed-off-by: dongdong tao <tdd21151186@gmail.com>
src/mds/MDSTable.cc

index 13a007d29bb252d7f5fe7169f9186ea6642906a0..96b51e89296cf283d9422c63abb59de81a45441f 100644 (file)
@@ -60,7 +60,8 @@ void MDSTable::save(MDSInternalContextBase *onfinish, version_t v)
   if (v > 0 && v <= committing_version) {
     dout(10) << "save v " << version << " - already saving "
             << committing_version << " >= needed " << v << dendl;
-    waitfor_save[v].push_back(onfinish);
+    if (onfinish)
+      waitfor_save[v].push_back(onfinish);
     return;
   }