[PATCH v3] nvme: fix nvme_ns_has_pi() to check PI size if metadata size or below
Tokunori Ikegami
ikegami.t at gmail.com
Tue Oct 22 11:10:54 PDT 2024
The PI is the first bytes or last bytes of the metadata.
So its size is not equal to the metadata size only but below also.
Signed-off-by: Tokunori Ikegami <ikegami.t at gmail.com>
---
Changes since v2 to v3:
- Delete the nvme_submit_io() changes as only change the nvme_ns_has_pi().
Changes since v1:
- Fix the commit message spelling miss hte to the.
drivers/nvme/host/nvme.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 093cb423f536..fbcb2243ba84 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -542,7 +542,7 @@ struct nvme_ns {
/* NVMe ns supports metadata actions by the controller (generate/strip) */
static inline bool nvme_ns_has_pi(struct nvme_ns_head *head)
{
- return head->pi_type && head->ms == head->pi_size;
+ return head->pi_type && head->ms >= head->pi_size;
}
struct nvme_ctrl_ops {
--
2.45.2
More information about the Linux-nvme
mailing list