From 9c68f3765beb42c5ce1c3545e3d1f25e27f50ca8 Mon Sep 17 00:00:00 2001 From: Vitaliy Kuznetsov Date: Thu, 28 Mar 2024 19:11:47 +0100 Subject: [PATCH] EX-9212 lipe: Fix for 'stripe_count = -1' in stats reports This patch corrects the display of the range for the table by the number of stripes. Now the range will only contain one position and will support a value of -1. Also corrects the display for a range in other tables by removing the fractional part. For example: [ -1 ] ... [ 1 ] ... [ 2 ] ... [ 10 ] ... Test-Parameters: trivial testlist=sanity-lipe-scan3,sanity-lipe-find3 Signed-off-by: Vitaliy Kuznetsov Change-Id: Iff1933f69b713c7e5dff9145c5516fa050294d2e Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54611 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lipe/src/lipe_scan3/ls3_stats.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/lipe/src/lipe_scan3/ls3_stats.c b/lipe/src/lipe_scan3/ls3_stats.c index 46ce8fc..b995a18 100644 --- a/lipe/src/lipe_scan3/ls3_stats.c +++ b/lipe/src/lipe_scan3/ls3_stats.c @@ -754,23 +754,26 @@ static void ls3_stats_get_range_str(struct range_report_template *range_ptr, { case LS3_STATS_TYPE_STORAGE_SET_SIZE_BY_USER: snprintf(str, strlen, - "%10lu (%14s)", range_ptr->rrt_id, + "%10ld (%14s)", range_ptr->rrt_id, ls3_stats_get_username_from_uid(range_ptr->rrt_id)); break; case LS3_STATS_TYPE_STORAGE_SET_SIZE_BY_GROUP: snprintf(str, strlen, - "%10lu (%14s)", range_ptr->rrt_id, + "%10ld (%14s)", range_ptr->rrt_id, ls3_stats_get_groupname_from_gid(range_ptr->rrt_id)); break; case LS3_STATS_TYPE_STORAGE_SET_SIZE_BY_PROJID: - snprintf(str, strlen, "%26lu ", range_ptr->rrt_id); + snprintf(str, strlen, "%26ld ", range_ptr->rrt_id); + break; + case LS3_STATS_TYPE_STRIPE_COUNT: + snprintf(str, strlen, "%26ld ", range_ptr->rrt_id); break; case LS3_STATS_TYPE_STRIPE_SIZE: - snprintf(str, strlen, "%18lu %7s ", range_ptr->rrt_id, + snprintf(str, strlen, "%18ld %7s ", range_ptr->rrt_id, value_ts); break; case LS3_STATS_TYPE_MIRROR_COUNT: - snprintf(str, strlen, "%26lu ", range_ptr->rrt_id); + snprintf(str, strlen, "%26ld ", range_ptr->rrt_id); break; case LS3_STATS_TYPE_TIME_SINCE_LAST_ACCESS_RF: case LS3_STATS_TYPE_TIME_SINCE_LAST_CREATION_RF: @@ -793,7 +796,7 @@ static void ls3_stats_get_range_str(struct range_report_template *range_ptr, case LS3_STATS_TYPE_FILES_SIZE: case LS3_STATS_TYPE_CAPACITY_USED: snprintf(str, strlen, - "%10.2f - %-10.2f %2s", range_ptr->range_start, + "%10.0f - %-10.0f %2s", range_ptr->range_start, range_ptr->range_end, value_ts); break; default: @@ -2328,9 +2331,10 @@ int ls3_stats_update_info(struct ls3_object_attrs *loa_all) LS3_INC_ERROR_COUNT(reports_with_stats, LS3_STATS_ERROR_GET_STRIPE_CNT); } else { - ls3_stats_update_range(LS3_STATS_TYPE_STRIPE_COUNT, - stripe_count, - LS3_STATS_EMPTY_VALUE); + ls3_stats_update_range_with_id( + LS3_STATS_TYPE_STRIPE_COUNT, + stripe_count, + loa_all->loa_size); } rc = llapi_layout_stripe_size_get(loa_all->loa_layout, -- 1.8.3.1