From: Xiangdong Mu Date: Wed, 16 Oct 2019 06:20:40 +0000 (+0800) Subject: rbd:the progress percent info exceeds 100% X-Git-Tag: v15.1.0~1165^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4877c8a12181ec9cbc1c1e59bea3a615e0367588;p=ceph.git rbd:the progress percent info exceeds 100% Signed-off-by: Xiangdong Mu --- diff --git a/src/tools/rbd/action/Create.cc b/src/tools/rbd/action/Create.cc index 30a0ba03f0a..02d5621177e 100644 --- a/src/tools/rbd/action/Create.cc +++ b/src/tools/rbd/action/Create.cc @@ -149,6 +149,9 @@ int write_data(librbd::Image &image, librbd::ImageOptions &opts, } ++i; off += tpw.chunk_size; + if(off > image_size) { + off = image_size; + } pc.update_progress(off, image_size); } }