From: Tokunori Ikegami Date: Sun, 16 Feb 2025 06:36:55 +0000 (+0900) Subject: nvme-print-binary: fix to output dispersed ns participating nss log length X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3634a930292127faab0ba653badf4966fe0fcfb9;p=users%2Fsagi%2Fnvme-cli.git nvme-print-binary: fix to output dispersed ns participating nss log length Previously only the log header output since the log length is changeable. The changes to output the changeable log length correctly. Signed-off-by: Tokunori Ikegami --- diff --git a/nvme-print-binary.c b/nvme-print-binary.c index bc88743b..2e9d7724 100644 --- a/nvme-print-binary.c +++ b/nvme-print-binary.c @@ -2,6 +2,7 @@ #include "nvme-print.h" #include "util/logging.h" +#include "common.h" static struct print_ops binary_print_ops; @@ -319,7 +320,7 @@ static void binary_rotational_media_info_log(struct nvme_rotational_media_info_l static void binary_dispersed_ns_psub_log(struct nvme_dispersed_ns_participating_nss_log *log) { - d_raw((unsigned char *)log, sizeof(*log)); + d_raw((unsigned char *)log, sizeof(*log) + le64_to_cpu(log->numpsub) * NVME_NQN_LENGTH); } static void binary_reachability_groups_log(struct nvme_reachability_groups_log *log, __u64 len)