Whamcloud - gitweb
EX-9007 lipe: Fix getting client mount path
authorVitaliy Kuznetsov <vkuznetsov@ddn.com>
Tue, 5 Mar 2024 16:51:40 +0000 (17:51 +0100)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 9 Mar 2024 07:46:49 +0000 (07:46 +0000)
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 <vkuznetsov@ddn.com>
Change-Id: Ibae2fa2428ae7e202b08acae9354f303bbdbd739
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54284
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Colin Faber <cfaber@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lipe/src/lipe_scan3/ls3_stats.c

index 37fe149..eba5a2c 100644 (file)
@@ -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;