aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Pravin <francis.p@samsung.com>2024-02-07 05:04:17 +0530
committerKeith Busch <kbusch@kernel.org>2024-02-07 15:49:36 -0800
commit4054705215ad7e6dd8e4e6ff27c39abd7667f700 (patch)
tree8a9f15ce945ed04d2636f0fc0b528f299bca95b2
parente8c263ed6de8183e670fbd127c2512292a2ad8eb (diff)
downloadlinux-sparc-4054705215ad7e6dd8e4e6ff27c39abd7667f700.tar.gz
nvme: use ns->head->pi_size instead of t10_pi_tuple structure size
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> Signed-off-by: Keith Busch <kbusch@kernel.org>
-rw-r--r--drivers/nvme/host/ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c
index 18f5c1be5d67e5..3dfd5ae99ae05e 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.