summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Mick <dan.mick@inktank.com>2013-01-04 18:00:24 -0800
committerDan Mick <dan.mick@inktank.com>2013-01-04 18:02:55 -0800
commit0978dc4963fe441fb67afecb074bc7b01798d59d (patch)
treeba974eeb12728291e12f445efaabe51545fd7ba8
parent6a3d475cf08eb3051e8cdbce10b17b53c92b9cb5 (diff)
downloadceph-0978dc4963fe441fb67afecb074bc7b01798d59d.tar.gz
rbd: Don't call ProgressContext's finish() if there's an error.
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>
-rw-r--r--src/rbd.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rbd.cc b/src/rbd.cc
index 2a13706f18e..9aaca568208 100644
--- a/src/rbd.cc
+++ b/src/rbd.cc
@@ -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;
}