Skip to content

Commit 363f636

Browse files
author
Christoph Hellwig
committed
nvme: don't return an error from nvme_configure_metadata
When a fabrics controller claims to support an invalidate metadata configuration we already warn and disable metadata support. No need to also return an error during revalidation. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Daniel Wagner <[email protected]> Tested-by: Kanchan Joshi <[email protected]>
1 parent bb49c6f commit 363f636

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/nvme/host/core.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,7 @@ static int nvme_setup_streams_ns(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
17231723
return 0;
17241724
}
17251725

1726-
static int nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id)
1726+
static void nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id)
17271727
{
17281728
struct nvme_ctrl *ctrl = ns->ctrl;
17291729

@@ -1739,15 +1739,16 @@ static int nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id)
17391739

17401740
ns->features &= ~(NVME_NS_METADATA_SUPPORTED | NVME_NS_EXT_LBAS);
17411741
if (!ns->ms || !(ctrl->ops->flags & NVME_F_METADATA_SUPPORTED))
1742-
return 0;
1742+
return;
1743+
17431744
if (ctrl->ops->flags & NVME_F_FABRICS) {
17441745
/*
17451746
* The NVMe over Fabrics specification only supports metadata as
17461747
* part of the extended data LBA. We rely on HCA/HBA support to
17471748
* remap the separate metadata buffer from the block layer.
17481749
*/
17491750
if (WARN_ON_ONCE(!(id->flbas & NVME_NS_FLBAS_META_EXT)))
1750-
return -EINVAL;
1751+
return;
17511752

17521753
ns->features |= NVME_NS_EXT_LBAS;
17531754

@@ -1774,8 +1775,6 @@ static int nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id)
17741775
else
17751776
ns->features |= NVME_NS_METADATA_SUPPORTED;
17761777
}
1777-
1778-
return 0;
17791778
}
17801779

17811780
static void nvme_set_queue_limits(struct nvme_ctrl *ctrl,
@@ -1916,9 +1915,7 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id)
19161915
ns->lba_shift = id->lbaf[lbaf].ds;
19171916
nvme_set_queue_limits(ns->ctrl, ns->queue);
19181917

1919-
ret = nvme_configure_metadata(ns, id);
1920-
if (ret)
1921-
goto out_unfreeze;
1918+
nvme_configure_metadata(ns, id);
19221919
nvme_set_chunk_sectors(ns, id);
19231920
nvme_update_disk_info(ns->disk, ns, id);
19241921

0 commit comments

Comments
 (0)