]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: current pc value should be greater than last_pc 38399/head
authores-gyt <57943316+es-gyt@users.noreply.github.com>
Wed, 2 Dec 2020 11:29:36 +0000 (19:29 +0800)
committeryite.gu <yite.gu@easystack.cn>
Fri, 4 Dec 2020 16:01:35 +0000 (00:01 +0800)
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 <yite.gu@easystack.cn>
src/tools/rbd/Utils.cc

index 6f2dfdcc1afb5e22b511aa5c8ed1dcb67ba8de89..27789df1d6eb01f48f62b3cac927ab1cceb88298 100644 (file)
@@ -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();