From 280724e6b5b68e32135b40632ff44c10581d6d3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Fri, 28 Apr 2023 17:38:10 +0200 Subject: [PATCH] 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. --- repos/os/src/drivers/nvme/main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/os/src/drivers/nvme/main.cc b/repos/os/src/drivers/nvme/main.cc index 0a296731ae..6797e2b777 100644 --- a/repos/os/src/drivers/nvme/main.cc +++ b/repos/os/src/drivers/nvme/main.cc @@ -1116,7 +1116,7 @@ class Nvme::Controller : Platform::Device, } Identify_ns_data nsdata((addr_t)_nvme_query_ns[id]->local_addr()); - uint32_t const flbas = nsdata.read(); + uint32_t const flbas = nsdata.read(); /* use array subscription, omit first entry */ uint16_t const ns_id = id + 1;