From: Nathaniel Clark Date: Thu, 7 Jan 2016 18:25:28 +0000 (-0500) Subject: LU-7635 utils: Fix lhsmtool_posix interval reporting X-Git-Tag: 2.7.66~14 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b964cd1c61858a090c812b31a2b3a2f9f94765fb LU-7635 utils: Fix lhsmtool_posix interval reporting 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 Change-Id: I0e85b81fa2a8cf16474cc832bca30bf1425fa81c Reviewed-on: http://review.whamcloud.com/17878 Tested-by: Maloo Reviewed-by: Robert Read Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/lhsmtool_posix.c b/lustre/utils/lhsmtool_posix.c index 70afeee..a8d7db40 100644 --- a/lustre/utils/lhsmtool_posix.c +++ b/lustre/utils/lhsmtool_posix.c @@ -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; }