[PATCH] Formatted LBA SIZE[FLBAS]
Keith Busch
kbusch at kernel.org
Mon Aug 9 07:48:35 PDT 2021
On Tue, Aug 03, 2021 at 10:59:12AM +0530, Sathyavathi M wrote:
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 11779be..49cca79 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -1683,6 +1683,9 @@ static int nvme_setup_streams_ns(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
> static int nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id)
> {
> struct nvme_ctrl *ctrl = ns->ctrl;
> + unsigned ls_lbaf = id->flbas & NVME_NS_FLBAS_LBA_LSMASK;
> + unsigned ms_lbaf = (id->flbas & NVME_NS_FLBAS_LBA_MSMASK) >> 1;
> + unsigned lbaf = ms_lbaf | ls_lbaf;
I don't think you tested this. In addition to what Niklas mentioned, the
above is useless without informing the controller the host supports the
extended LBA format. You have to enable that in the Host Behavior
Support feature LBAFEE field.
More information about the Linux-nvme
mailing list