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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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.