diff options
author | Francis Pravin | 2024-02-07 05:04:17 +0530 |
---|---|---|
committer | Keith Busch | 2024-02-07 15:49:36 -0800 |
commit | 4054705215ad7e6dd8e4e6ff27c39abd7667f700 (patch) | |
tree | 8a9f15ce945ed04d2636f0fc0b528f299bca95b2 /drivers | |
parent | e8c263ed6de8183e670fbd127c2512292a2ad8eb (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/nvme/host/ioctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/ioctl.c b/drivers/nvme/host/ioctl.c index 18f5c1be5d67..3dfd5ae99ae0 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. |