]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print-binary: fix to output dispersed ns participating nss log length
authorTokunori Ikegami <ikegami.t@gmail.com>
Sun, 16 Feb 2025 06:36:55 +0000 (15:36 +0900)
committerDaniel Wagner <wagi@monom.org>
Mon, 17 Feb 2025 14:39:11 +0000 (15:39 +0100)
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 <ikegami.t@gmail.com>
nvme-print-binary.c

index bc88743b7bc655f524b9dc288b0fa43877baf887..2e9d7724268722dedca87d23fcc538d2585608e8 100644 (file)
@@ -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)