Whamcloud - gitweb
LU-7635 utils: Fix lhsmtool_posix interval reporting 78/17878/4
authorNathaniel Clark <nathaniel.l.clark@intel.com>
Thu, 7 Jan 2016 18:25:28 +0000 (13:25 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 26 Jan 2016 20:20:29 +0000 (20:20 +0000)
At specified time intervals lhsmtool_posix reports how much data it's
written.  It should report how much data has been written since last
update, but it reports total data written.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: I0e85b81fa2a8cf16474cc832bca30bf1425fa81c
Reviewed-on: http://review.whamcloud.com/17878
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Robert Read <robert.read@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/lhsmtool_posix.c

index 70afeee..a8d7db4 100644 (file)
@@ -660,7 +660,9 @@ static int ct_copy_data(struct hsm_copyaction_private *hcp, const char *src,
                if (now >= last_report_time + opt.o_report_int) {
                        last_report_time = now;
                        CT_TRACE("%%"LPU64" ", 100 * write_total / length);
-                       he.length = write_total;
+                       /* only give the length of the write since the last
+                        * progress report */
+                       he.length = offset - he.offset;
                        rc = llapi_hsm_action_progress(hcp, &he, length, 0);
                        if (rc < 0) {
                                /* Action has been canceled or something wrong
@@ -669,6 +671,7 @@ static int ct_copy_data(struct hsm_copyaction_private *hcp, const char *src,
                                         " '%s'->'%s' failed", src, dst);
                                goto out;
                        }
+                       he.offset = offset;
                }
                rc = 0;
        }