]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: Don't call ProgressContext's finish() if there's an error.
authorDan Mick <dan.mick@inktank.com>
Sat, 5 Jan 2013 02:00:24 +0000 (18:00 -0800)
committerDan Mick <dan.mick@inktank.com>
Sat, 5 Jan 2013 02:02:55 +0000 (18:02 -0800)
do_copy was different from the others; call pc.fail() on error and
do not call pc.finish().

Fixes: #3729
Signed-off-by: Dan Mick <dan.mick@inktank.com>
src/rbd.cc

index 2a13706f18ed5bbc6661de3473780081b676b569..9aaca568208cb2a767a54513c55b18c0a500b2da 100644 (file)
@@ -1082,9 +1082,11 @@ static int do_copy(librbd::Image &src, librados::IoCtx& dest_pp,
 {
   MyProgressContext pc("Image copy");
   int r = src.copy_with_progress(dest_pp, destname, pc);
-  pc.finish();
-  if (r < 0)
+  if (r < 0){
+    pc.fail();
     return r;
+  }
+  pc.finish();
   return 0;
 }