From e5c4ea7131c1a12732e6982b45b4d68e7b75f34e Mon Sep 17 00:00:00 2001 From: stevegalbraith Date: Wed, 27 May 2015 09:36:38 -0700 Subject: [PATCH] Fix to determine initial value for lba in print_list_item The index used to determine lba value takes into accout the entire FLBAS field. Bit 4 determines whether an extended or separate is used to send metadata and if set to 1'b, throws off the index value. Masked out the top 4 bits to only take into account Bits 3:0 which indicate the LBA format type used. --- nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvme.c b/nvme.c index c4bb3695..599c5484 100644 --- a/nvme.c +++ b/nvme.c @@ -1259,7 +1259,7 @@ static void print_list_item(struct list_item list_item) double nsze = list_item.ns.nsze; double nuse = list_item.ns.nuse; - long long int lba = list_item.ns.lbaf[list_item.ns.flbas].ds; + long long int lba = list_item.ns.lbaf[(list_item.ns.flbas & 0x0f)].ds; lba = (1 << lba); nsze *= lba; -- 2.50.1