nvme_drv: read proper FLBAS value

Bit 0:3 indicate which of the (up to) 16 supported LBA formats is
used for this namespace. Instead of only looking at those bits the
driver looked at the complete 0:7 bits. Those, however, also include
information on how metadata may be transferred. That leads to using
the wrong index for reading the LBA format.

Fixes #4832.
This commit is contained in:
Josef Söntgen 2023-04-28 17:38:10 +02:00 committed by Christian Helmuth
parent 4a5d31e248
commit 280724e6b5

View File

@ -1116,7 +1116,7 @@ class Nvme::Controller : Platform::Device,
}
Identify_ns_data nsdata((addr_t)_nvme_query_ns[id]->local_addr<void>());
uint32_t const flbas = nsdata.read<Nvme::Identify_ns_data::Flbas>();
uint32_t const flbas = nsdata.read<Nvme::Identify_ns_data::Flbas::Formats>();
/* use array subscription, omit first entry */
uint16_t const ns_id = id + 1;