From: Tokunori Ikegami <ikegami.t@gmail.com>
To: linux-nvme@lists.infradead.org
Cc: Tokunori Ikegami <ikegami.t@gmail.com>
Subject: [PATCH v3] nvme: fix nvme_ns_has_pi() to check PI size if metadata size or below
Date: Wed, 23 Oct 2024 03:10:54 +0900 [thread overview]
Message-ID: <20241022181132.19871-1-ikegami.t@gmail.com> (raw)
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@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
next reply other threads:[~2024-10-22 19:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 18:10 Tokunori Ikegami [this message]
2024-10-22 19:20 ` [PATCH v3] nvme: fix nvme_ns_has_pi() to check PI size if metadata size or below Keith Busch
2024-10-23 10:10 ` Tokunori Ikegami
2024-10-23 12:45 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241022181132.19871-1-ikegami.t@gmail.com \
--to=ikegami.t@gmail.com \
--cc=linux-nvme@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox