linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH 1/3] nvme: do not check for ns on rw path
Date: Mon, 6 Nov 2017 07:43:04 -0700	[thread overview]
Message-ID: <20171106144303.GA11677@localhost.localdomain> (raw)
In-Reply-To: <20171106091323.GA30382@lst.de>

On Mon, Nov 06, 2017@10:13:24AM +0100, Christoph Hellwig wrote:
> On Sat, Nov 04, 2017@09:38:45AM -0600, Keith Busch wrote:
> > That's not quite right. For non-PI metadata formats, we use the
> > 'nop_profile', which gets the metadata buffer allocated so we can safely
> > use a metadata formatted namespace. There's no in-kernel user of the
> > allocated payload, but we still need the metadata buffer in order to
> > use the namespace at all.
> 
> You're right.  But that means we will indeed always have a matching
> integrity payload here and the check should not be needed.
> 
> Are you fine with turning it into something like:
> 
> 	if (WARN_ON_ONCE(ns->ms && !blk_integrity_rq(req)))
> 		return BLK_STS_IOERR;
> 
> ?

Yes, that looks fine. You're right that we are not supposed to be able
to get into this path for read/write since the driver sets the capacity
to 0 if a metadata format doesn't have integrity support, so hitting
this warning would indicate something has gone wrong.

  reply	other threads:[~2017-11-06 14:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 10:02 [PATCH 0/3] nvme: small fixes reported by smatch Javier González
2017-11-03 10:02 ` [PATCH 1/3] nvme: do not check for ns on rw path Javier González
2017-11-03 12:53   ` Christoph Hellwig
2017-11-03 13:00     ` Javier González
2017-11-03 15:02     ` Keith Busch
2017-11-04  8:18       ` Christoph Hellwig
2017-11-04 15:38         ` Keith Busch
2017-11-06  9:13           ` Christoph Hellwig
2017-11-06 14:43             ` Keith Busch [this message]
2017-11-03 10:02 ` [PATCH 2/3] nvme: compare NQN string with right size Javier González
2017-11-03 12:54   ` Christoph Hellwig
2017-11-03 12:56     ` Javier González
2017-11-03 10:02 ` [PATCH 3/3] nvme: fix eui_show() print format Javier González
2017-11-03 12:55   ` Christoph Hellwig
2017-11-03 15:13     ` Keith Busch
2017-11-03 15:16     ` Joe Perches
2017-11-04 11:22       ` Javier González
2017-11-07 16:28         ` Christoph Hellwig
2017-11-07 16:36           ` Javier González

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171106144303.GA11677@localhost.localdomain \
    --to=keith.busch@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).