Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: keith.busch@intel.com (Keith Busch)
Subject: [PATCH] nvme: improve check for attached metadata buffers
Date: Mon, 6 Nov 2017 12:55:53 -0700	[thread overview]
Message-ID: <20171106195552.GH11677@localhost.localdomain> (raw)
In-Reply-To: <20171106190152.30483-1-hch@lst.de>

On Mon, Nov 06, 2017@08:01:52PM +0100, Christoph Hellwig wrote:
> @@ -476,14 +476,11 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns,
>  	u32 dsmgmt = 0;
>  
>  	/*
> -	 * If formated with metadata, require the block layer provide a buffer
> -	 * unless this namespace is formated such that the metadata can be
> -	 * stripped/generated by the controller with PRACT=1.
> +	 * The block layer should always provide a metadata buffer if the
> +	 * namespace is formatted with metadata.
>  	 */
> -	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;
> +	if (WARN_ON_ONCE(ns->ms && !blk_integrity_rq(req)))
> +		return BLK_STS_IOERR;

Sorry for missing this case earlier: this will break namespace usage
when CONFIG_BLK_DEV_INTEGRITY is not set, and the format allows PRACT=1
to strip/generate.

  reply	other threads:[~2017-11-06 19:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06 19:01 [PATCH] nvme: improve check for attached metadata buffers Christoph Hellwig
2017-11-06 19:55 ` Keith Busch [this message]
2017-11-06 20:26   ` Christoph Hellwig
2017-11-07  0:00     ` Keith Busch

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=20171106195552.GH11677@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