nvme: don't hard code size of struct t10_pi_tuple
Sagi Grimberg
maintainerPATCH 1/1 nvme: don't hard code size of struct t10_pi_tuple
Signed-off-by Sagi Grimberg <sagi at grimberg.me>
--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +2 -1
@@ -336,7 +336,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 ;
Signature · 1 line
2.7.4
Christoph Hellwig
maintainerPATCH 1/1 nvme: don't hard code size of struct t10_pi_tuple
Quoted 10 lines · Sagi Grimberg
Signed-off-by Sagi Grimberg <sagi at grimberg.me>--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/nvme/host/core.c +0
-0
drivers/nvme/host/core.c static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns, · line 340
Quoted 6 lines
drivers/nvme/host/core.c +2
-1@@ -336,7 +336,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)) &&
This actually got the braces wrong, I'll fix it up.
Christoph Hellwig
maintainerPATCH 1/1 nvme: don't hard code size of struct t10_pi_tuple
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Sagi Grimberg
Signed-off-by Sagi Grimberg <sagi at grimberg.me>--- drivers/nvme/host/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 13 lines
drivers/nvme/host/core.c static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns, · line 340
Quoted 11 lines
drivers/nvme/host/core.c +2
-1@@ -336,7 +336,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)) &&This actually got the braces wrong, I'll fix it up.
Actually I only applied your already fixed up V2. -ENOCOFFEE