diff options
author | Sage Weil <sage@newdream.net> | 2011-10-10 18:50:33 +0200 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2011-10-10 18:50:33 +0200 |
commit | 7060efa9bae6d27bf44fbdc0a89698a31fd8c6c4 (patch) | |
tree | 8024b1a61ef5f70f6241cde1fd8e00a7acb7e2cb | |
parent | auth: move AuthAuthorizeHandler registry into class (diff) | |
download | ceph-7060efa9bae6d27bf44fbdc0a89698a31fd8c6c4.tar.xz ceph-7060efa9bae6d27bf44fbdc0a89698a31fd8c6c4.zip |
librbd: fix copy progress
Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r-- | src/librbd.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/librbd.cc b/src/librbd.cc index a61fee96739..2f0ecc77a2c 100644 --- a/src/librbd.cc +++ b/src/librbd.cc @@ -1107,13 +1107,14 @@ struct CopyProgressCtx { int do_copy_extent(uint64_t offset, size_t len, const char *buf, void *data) { CopyProgressCtx *cp = reinterpret_cast<CopyProgressCtx*>(data); + cp->prog_ctx.update_progress(offset, cp->src_size); + int ret = 0; if (buf) { - int ret = write(cp->destictx, offset, len, buf); - if (ret) { + ret = write(cp->destictx, offset, len, buf); + if (ret < 0) return ret; - } } - return cp->prog_ctx.update_progress(offset, cp->src_size); + return ret; } ProgressContext::~ProgressContext() |