From: es-gyt <57943316+es-gyt@users.noreply.github.com> Date: Wed, 2 Dec 2020 11:29:36 +0000 (+0800) Subject: rbd: current pc value should be greater than last_pc X-Git-Tag: v16.1.0~376^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F38399%2Fhead;p=ceph.git rbd: current pc value should be greater than last_pc If rbd image enabled striping feature, stderr will print repeat rate of progress when execu rbd export-diff. Fixes: https://tracker.ceph.com/issues/48431 Signed-off-by: Yite Gu --- diff --git a/src/tools/rbd/Utils.cc b/src/tools/rbd/Utils.cc index 6f2dfdcc1af..27789df1d6e 100644 --- a/src/tools/rbd/Utils.cc +++ b/src/tools/rbd/Utils.cc @@ -45,7 +45,7 @@ static std::string mgr_command_args_to_str( int ProgressContext::update_progress(uint64_t offset, uint64_t total) { if (progress) { int pc = total ? (offset * 100ull / total) : 0; - if (pc != last_pc) { + if (pc > last_pc) { cerr << "\r" << operation << ": " << pc << "% complete..."; cerr.flush();