From: Xiangdong Mu Date: Wed, 16 Oct 2019 06:20:40 +0000 (+0800) Subject: rbd:the progress percent info exceeds 100% X-Git-Tag: v14.2.8~78^2~22^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8fc22dc53939f4b862102e7ea2e4877ba67dd3c7;p=ceph.git rbd:the progress percent info exceeds 100% Signed-off-by: Xiangdong Mu (cherry picked from commit 4877c8a12181ec9cbc1c1e59bea3a615e0367588) --- diff --git a/src/tools/rbd/action/Create.cc b/src/tools/rbd/action/Create.cc index 5a168d9bc268..99efa0b50ad2 100644 --- a/src/tools/rbd/action/Create.cc +++ b/src/tools/rbd/action/Create.cc @@ -151,6 +151,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); } }