From: Sage Weil Date: Mon, 3 Feb 2014 01:11:23 +0000 (-0800) Subject: osd/ReplicatedPG: do not choke on op-less flush OpContexts (from flush) X-Git-Tag: v0.78~166^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f617eba03461a8773bbf30ad5cfc5e1e99b944a3;p=ceph.git osd/ReplicatedPG: do not choke on op-less flush OpContexts (from flush) 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index b5bff0e6265f..ad1d2cfa73c7 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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); }