]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: avoid null deref of repop->ctx->op
authorSage Weil <sage@newdream.net>
Thu, 2 Feb 2012 23:07:54 +0000 (15:07 -0800)
committerSage Weil <sage@newdream.net>
Thu, 2 Feb 2012 23:07:54 +0000 (15:07 -0800)
It's optional.

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/ReplicatedPG.cc

index 6997d3196d42c5ba838a80d07fa074c85eaa482d..825fdad8df6cbded38d7a52fd497b7ba6257ed33 100644 (file)
@@ -2955,7 +2955,9 @@ void ReplicatedPG::op_commit(RepGather *repop)
 
 void ReplicatedPG::eval_repop(RepGather *repop)
 {
-  MOSDOp *m = (MOSDOp *)repop->ctx->op->request;
+  MOSDOp *m = NULL;
+  if (repop->ctx->op)
+    m = (MOSDOp *)repop->ctx->op->request;
 
   if (m)
     dout(10) << "eval_repop " << *repop