]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do not dereference ctx->op when NULL
authorSage Weil <sage@newdream.net>
Thu, 2 Feb 2012 20:36:27 +0000 (12:36 -0800)
committerSage Weil <sage@newdream.net>
Thu, 2 Feb 2012 20:36:27 +0000 (12:36 -0800)
We may not have an OpRequest.  Make the later check do the cast properly
when it is needed.

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

index 64532ec2c777462b7d2742ce4b6310d1a2e2b096..a19634cfb58be4207f36956a1632ddda8a20bff8 100644 (file)
@@ -3048,7 +3048,6 @@ void ReplicatedPG::issue_repop(RepGather *repop, utime_t now,
 {
   OpContext *ctx = repop->ctx;
   const hobject_t& soid = ctx->obs->oi.soid;
-  MOSDOp *m = (MOSDOp *)ctx->op->request;
 
   dout(7) << "issue_repop rep_tid " << repop->rep_tid
           << " o " << soid
@@ -3075,8 +3074,8 @@ void ReplicatedPG::issue_repop(RepGather *repop, utime_t now,
                                  false, acks_wanted,
                                  get_osdmap()->get_epoch(),
                                  repop->rep_tid, repop->ctx->at_version);
-
-    if (m && m->get_flags() & CEPH_OSD_FLAG_PARALLELEXEC) {
+    if (ctx->op &&
+       (((MOSDOp *)ctx->op->request)->get_flags() & CEPH_OSD_FLAG_PARALLELEXEC)) {
       // replicate original op for parallel execution on replica
       assert(0 == "broken implementation, do not use");
       wr->oloc = repop->ctx->obs->oi.oloc;