Skip to content

Commit 4054705

Browse files
francispravin5keithbusch
authored andcommitted
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>
1 parent e8c263e commit 4054705

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/host/ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ static int nvme_submit_io(struct nvme_ns *ns, struct nvme_user_io __user *uio)
228228
length = (io.nblocks + 1) << ns->head->lba_shift;
229229

230230
if ((io.control & NVME_RW_PRINFO_PRACT) &&
231-
ns->head->ms == sizeof(struct t10_pi_tuple)) {
231+
(ns->head->ms == ns->head->pi_size)) {
232232
/*
233233
* Protection information is stripped/inserted by the
234234
* controller.

0 commit comments

Comments
 (0)