]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedPG: do not choke on op-less flush OpContexts (from flush)
authorSage Weil <sage@inktank.com>
Mon, 3 Feb 2014 01:11:23 +0000 (17:11 -0800)
committerSage Weil <sage@inktank.com>
Sun, 16 Feb 2014 06:09:39 +0000 (22:09 -0800)
The agent initiates flush ops that don't have an OpRequest associated
with them.  Make reply_ctx skip the actual reply message instead of
crashing if the flush request gets canceled (e.g., due to a race with
a write).

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

index b5bff0e6265f3e321c9384b4bf8028b7537149f9..ad1d2cfa73c7f798d9fae428cc23cda7de1e77bb 100644 (file)
@@ -162,9 +162,11 @@ public:
     ctx->copy_cb = NULL;
     if (r < 0) {
       if (r != -ECANCELED) { // on cancel just toss it out; client resends
-       ctx->pg->osd->reply_op_error(ctx->op, r);
+       if (ctx->op)
+         ctx->pg->osd->reply_op_error(ctx->op, r);
       } else if (results->should_requeue) {
-       ctx->pg->requeue_op(ctx->op);
+       if (ctx->op)
+         ctx->pg->requeue_op(ctx->op);
       }
       ctx->pg->close_op_ctx(ctx, r);
     }
@@ -1718,13 +1720,15 @@ void ReplicatedPG::execute_ctx(OpContext *ctx)
 
 void ReplicatedPG::reply_ctx(OpContext *ctx, int r)
 {
-  osd->reply_op_error(ctx->op, r);
+  if (ctx->op)
+    osd->reply_op_error(ctx->op, r);
   close_op_ctx(ctx, r);
 }
 
 void ReplicatedPG::reply_ctx(OpContext *ctx, int r, eversion_t v, version_t uv)
 {
-  osd->reply_op_error(ctx->op, r, v, uv);
+  if (ctx->op)
+    osd->reply_op_error(ctx->op, r, v, uv);
   close_op_ctx(ctx, r);
 }