From mboxrd@z Thu Jan 1 00:00:00 1970 From: hch@lst.de (Christoph Hellwig) Date: Fri, 16 Jun 2017 08:29:29 +0200 Subject: [PATCH] nvme: don't hard code size of struct t10_pi_tuple In-Reply-To: <20170616062840.GB6797@lst.de> References: <1497533358-9901-1-git-send-email-sagi@grimberg.me> <20170616062840.GB6797@lst.de> Message-ID: <20170616062928.GA6844@lst.de> 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 > > --- > > 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