]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: copy: don't leak a ctx on failed copy ops
authorGreg Farnum <greg@inktank.com>
Fri, 4 Oct 2013 16:47:54 +0000 (09:47 -0700)
committerGreg Farnum <greg@inktank.com>
Fri, 4 Oct 2013 19:59:05 +0000 (12:59 -0700)
Signed-off-by: Greg Farnum <greg@inktank.com>
src/osd/ReplicatedPG.h

index 2a8b722c752c82fd983a8883967eab8a0ac0fa90..f337a8f4202233e67984195e4d3d885992071b46 100644 (file)
@@ -180,11 +180,10 @@ public:
       }
       ctx->copy_cb = NULL;
       if (r < 0) {
-       if (r == -ECANCELED) { // toss it out; client resends
-         delete ctx;
-       } else {
+       if (r != -ECANCELED) { // on cancel just toss it out; client resends
          ctx->pg->osd->reply_op_error(ctx->op, r);
        }
+       delete ctx;
       }
     }