From 2ea53c8a840a973d1d557833c894b7effcfacc3e Mon Sep 17 00:00:00 2001 From: Vitaliy Kuznetsov Date: Tue, 5 Mar 2024 17:51:40 +0100 Subject: [PATCH] EX-9007 lipe: Fix getting client mount path This patch fixes a "Segmentation fault" issue related to the generation of size statistics report in '*.json' format when the client is unmounted Test-Parameters: trivial testlist=sanity-lipe-scan3 Signed-off-by: Vitaliy Kuznetsov Change-Id: Ibae2fa2428ae7e202b08acae9354f303bbdbd739 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54284 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Colin Faber Reviewed-by: Andreas Dilger --- lipe/src/lipe_scan3/ls3_stats.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lipe/src/lipe_scan3/ls3_stats.c b/lipe/src/lipe_scan3/ls3_stats.c index 37fe149..eba5a2c 100644 --- a/lipe/src/lipe_scan3/ls3_stats.c +++ b/lipe/src/lipe_scan3/ls3_stats.c @@ -827,8 +827,11 @@ static void ls3_stats_print_to_json(const char *f_time, double e_time) json_object_object_add(jobj_main, "FreeInodesCountOnDevice", json_object_new_int(reports_with_stats->free_inodes_count)); - json_object_object_add(jobj_main, "ClientMountPath", - json_object_new_string(reports_with_stats->client_mount_path)); + if (reports_with_stats->client_mount_path) { + json_object_object_add(jobj_main, "ClientMountPath", + json_object_new_string( + reports_with_stats->client_mount_path)); + } for (i = 0; i < LS3_STATS_TYPE_TOTAL_COUNT_REPORT; i++) { struct json_object *jobj_report; -- 1.8.3.1