Commit 40547052 authored by Francis Pravin's avatar Francis Pravin Committed by Keith Busch

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: default avatarFrancis Pravin <francis.p@samsung.com>
Signed-off-by: default avatarSathyavathi M <sathya.m@samsung.com>
Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
parent e8c263ed
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment