Skip to content

Commit eeaa50d

Browse files
francispravin5igaw
authored andcommitted
nvme-print-stdout: fix format index in stdout_nvm_id_ns
Use nvme_id_ns_flbas_to_lbaf_inuse() to get the proper format index of the namespace. Signed-off-by: Francis Pravin <francis.p@samsung.com>
1 parent 67abaaa commit eeaa50d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nvme-print-stdout.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -3062,9 +3062,12 @@ static void stdout_nvm_id_ns(struct nvme_nvm_id_ns *nvm_ns, unsigned int nsid,
30623062
{
30633063
int i, verbose = stdout_print_ops.flags & VERBOSE;
30643064
__u32 elbaf;
3065+
__u8 lbaf;
30653066
int pif, sts;
30663067
char *in_use = "(in use)";
30673068

3069+
nvme_id_ns_flbas_to_lbaf_inuse(ns->flbas, &lbaf);
3070+
30683071
if (!cap_only) {
30693072
printf("NVMe NVM Identify Namespace %d:\n", nsid);
30703073
printf("lbstm : %#"PRIx64"\n", le64_to_cpu(nvm_ns->lbstm));
@@ -3086,10 +3089,10 @@ static void stdout_nvm_id_ns(struct nvme_nvm_id_ns *nvm_ns, unsigned int nsid,
30863089
i, pif == 3 ? "Reserved" :
30873090
pif == 2 ? "64b Guard" :
30883091
pif == 1 ? "32b Guard" : "16b Guard",
3089-
pif, sts, i == (ns->flbas & 0xf) ? in_use : "");
3092+
pif, sts, i == lbaf ? in_use : "");
30903093
else
30913094
printf("elbaf %2d : pif:%d sts:%-2d %s\n", i,
3092-
pif, sts, i == (ns->flbas & 0xf) ? in_use : "");
3095+
pif, sts, i == lbaf ? in_use : "");
30933096
}
30943097
}
30953098

0 commit comments

Comments
 (0)