Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: francis.p@samsung.com
To: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me
Cc: linux-nvme@lists.infradead.org, sathya.m@samsung.com,
	d.palani@samsung.com, prakash.bv@samsung.com, anshul@samsung.com,
	Francis Pravin <francis.p@samsung.com>
Subject: [PATCH] nvme: use ns->head->pi_size instead of t10_pi_tuple structure size
Date: Wed,  7 Feb 2024 05:04:17 +0530	[thread overview]
Message-ID: <1707262457-20904-1-git-send-email-francis.p@samsung.com> (raw)
In-Reply-To: CGME20240207050232epcas5p4f6fcd56e72f6b25fe44123df4597a770@epcas5p4.samsung.com

From: Francis Pravin <francis.p@samsung.com>

Currently kernel supports 8 byte and 16 byte protection information.
So, use ns->head->pi_size instead of sizeof(struct t10_pi_tuple).

Signed-off-by: Francis Pravin <francis.p@samsung.com>
Signed-off-by: Sathyavathi M <sathya.m@samsung.com>
---
 drivers/nvme/host/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
index 18f5c1be..3dfd5ae9 100644
--- a/drivers/nvme/host/ioctl.c
+++ b/drivers/nvme/host/ioctl.c
@@ -228,7 +228,7 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio)
 	length = (io.nblocks + 1) << ns->head->lba_shift;
 
 	if ((io.control & NVME_RW_PRINFO_PRACT) &&
-	    ns->head->ms == sizeof(struct t10_pi_tuple)) {
+	    (ns->head->ms == ns->head->pi_size)) {
 		/*
 		 * Protection information is stripped/inserted by the
 		 * controller.
-- 
1.8.3.1



       reply	other threads:[~2024-02-07  7:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20240207050232epcas5p4f6fcd56e72f6b25fe44123df4597a770@epcas5p4.samsung.com>
2024-02-06 23:34 ` francis.p [this message]
2024-02-07 23:57   ` [PATCH] nvme: use ns->head->pi_size instead of t10_pi_tuple structure size Keith Busch

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=1707262457-20904-1-git-send-email-francis.p@samsung.com \
    --to=francis.p@samsung.com \
    --cc=anshul@samsung.com \
    --cc=axboe@fb.com \
    --cc=d.palani@samsung.com \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=prakash.bv@samsung.com \
    --cc=sagi@grimberg.me \
    --cc=sathya.m@samsung.com \
    /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