From 83c91fa68cf841827e88ad61ad63bfa9663e6601 Mon Sep 17 00:00:00 2001 From: Xiangdong Mu Date: Wed, 16 Oct 2019 14:20:40 +0800 Subject: [PATCH] rbd:the progress percent info exceeds 100% Signed-off-by: Xiangdong Mu (cherry picked from commit 4877c8a12181ec9cbc1c1e59bea3a615e0367588) --- src/tools/rbd/action/Create.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/rbd/action/Create.cc b/src/tools/rbd/action/Create.cc index 028530b7026c1..888055a708a7c 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); } } -- 2.39.5