From 8e36435d62dc6771914f174bec8d4232ecf4c7c2 Mon Sep 17 00:00:00 2001 From: es-gyt <57943316+es-gyt@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:29:36 +0800 Subject: [PATCH] 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 --- src/tools/rbd/Utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rbd/Utils.cc b/src/tools/rbd/Utils.cc index 6f2dfdcc1afb..27789df1d6eb 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(); -- 2.47.3