summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSagi Grimberg <sagi@grimberg.me>2017-06-15 16:31:29 +0300
committerChristoph Hellwig <hch@lst.de>2017-06-15 15:50:18 +0200
commit8fa611213d29cd62908adfa2dfd451b2de1737b3 (patch)
treeaa2a2088aef80678e77fbbe02cea7b25ba5fbbd2 /drivers
parent39bdc5901f2525de3afab8a30b7acc04f6ce41c3 (diff)
nvme: don't hard code size of struct t10_pi_tuple
Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nvme/host/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 73342b74d3bf..4ff5114f467d 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -356,7 +356,8 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns,
* unless this namespace is formated such that the metadata can be
* stripped/generated by the controller with PRACT=1.
*/
- if (ns && ns->ms && (!ns->pi_type || ns->ms != 8) &&
+ if (ns && ns->ms &&
+ (!ns->pi_type || ns->ms != sizeof(struct t10_pi_tuple)) &&
!blk_integrity_rq(req) && !blk_rq_is_passthrough(req))
return BLK_STS_NOTSUPP;