diff options
author | Dan Mick <dan.mick@inktank.com> | 2013-01-04 18:00:24 -0800 |
---|---|---|
committer | Dan Mick <dan.mick@inktank.com> | 2013-01-04 18:02:55 -0800 |
commit | 0978dc4963fe441fb67afecb074bc7b01798d59d (patch) | |
tree | ba974eeb12728291e12f445efaabe51545fd7ba8 | |
parent | 6a3d475cf08eb3051e8cdbce10b17b53c92b9cb5 (diff) | |
download | ceph-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.cc | 6 |
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; } |