* [PATCH] nvme: don't hard code size of struct t10_pi_tuple
@ 2017-06-15 13:29 Sagi Grimberg
2017-06-16 6:28 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Sagi Grimberg @ 2017-06-15 13:29 UTC (permalink / raw)
Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
drivers/nvme/host/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index a5b7926cf7f6..761ca3e6ee2e 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -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;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] nvme: don't hard code size of struct t10_pi_tuple
2017-06-15 13:29 [PATCH] nvme: don't hard code size of struct t10_pi_tuple Sagi Grimberg
@ 2017-06-16 6:28 ` Christoph Hellwig
2017-06-16 6:29 ` Christoph Hellwig
0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2017-06-16 6:28 UTC (permalink / raw)
On Thu, Jun 15, 2017@04:29:18PM +0300, Sagi Grimberg wrote:
> Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> ---
> drivers/nvme/host/core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index a5b7926cf7f6..761ca3e6ee2e 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] nvme: don't hard code size of struct t10_pi_tuple
2017-06-16 6:28 ` Christoph Hellwig
@ 2017-06-16 6:29 ` Christoph Hellwig
0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2017-06-16 6:29 UTC (permalink / raw)
On Fri, Jun 16, 2017@08:28:40AM +0200, Christoph Hellwig wrote:
> On Thu, Jun 15, 2017@04:29:18PM +0300, Sagi Grimberg wrote:
> > Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
> > ---
> > drivers/nvme/host/core.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> > index a5b7926cf7f6..761ca3e6ee2e 100644
> > --- a/drivers/nvme/host/core.c
> > +++ b/drivers/nvme/host/core.c
> > @@ -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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-16 6:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-15 13:29 [PATCH] nvme: don't hard code size of struct t10_pi_tuple Sagi Grimberg
2017-06-16 6:28 ` Christoph Hellwig
2017-06-16 6:29 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.