All of lore.kernel.org
 help / color / mirror / Atom feed
From: dan.j.williams@intel.com (Williams, Dan J)
Subject: [PATCH 08/11] nvme: suspend i/o during runtime blk_integrity_unregister
Date: Wed, 14 Oct 2015 19:36:24 +0000	[thread overview]
Message-ID: <1444851383.3409.3.camel@intel.com> (raw)
In-Reply-To: <CAPcyv4iCGu4osMe+SJTykDQjx103DzDdamqkK0J6b=H3Y5OHRw@mail.gmail.com>

On Wed, 2015-10-14@11:17 -0700, Dan Williams wrote:
> On Wed, Oct 14, 2015@6:59 AM, Keith Busch <keith.busch@intel.com> wrote:
> > On Tue, 13 Oct 2015, Dan Williams wrote:
> >>
> >> Synchronize pending i/o against a change in the integrity profile to
> >> avoid the possibility of spurious integrity errors.
> >
> >
> > Looks good. Do we need to freeze the queue if we are register an
> > integrity profile as well?
> >
> 
> Indeed we do, I'll refresh the patch.  Thanks for that catch.

I moved the freeze to cover all the queue manipulations in
nvme_revalidate_disk()

(git am --scissors)
8<----
Subject: nvme: suspend i/o during runtime blk_integrity_unregister

From: Dan Williams <dan.j.williams@intel.com>

Synchronize pending i/o against a change in the integrity profile to
avoid the possibility of spurious integrity errors.

Cc: Matthew Wilcox <willy at linux.intel.com>
Cc: Keith Busch <keith.busch at intel.com>
[keith: also protect dynamic integrity registration]
Signed-off-by: Dan Williams <dan.j.williams at intel.com>
---
 drivers/nvme/host/pci.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index 65190e51aa47..5578de67f406 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2033,6 +2033,7 @@ static int nvme_revalidate_disk(struct gendisk *disk)
 	pi_type = ns->ms == sizeof(struct t10_pi_tuple) ?
 					id->dps & NVME_NS_DPS_PI_MASK : 0;
 
+	blk_mq_freeze_queue(disk->queue);
 	if (blk_get_integrity(disk) && (ns->pi_type != pi_type ||
 				ns->ms != old_ms ||
 				bs != queue_logical_block_size(disk->queue) ||
@@ -2052,6 +2053,7 @@ static int nvme_revalidate_disk(struct gendisk *disk)
 
 	if (dev->oncs & NVME_CTRL_ONCS_DSM)
 		nvme_config_discard(ns);
+	blk_mq_unfreeze_queue(disk->queue);
 
 	kfree(id);
 	return 0;

  reply	other threads:[~2015-10-14 19:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20151014022757.34443.25800.stgit@dwillia2-desk3.jf.intel.com>
2015-10-14  2:37 ` [PATCH 00/11] blk_integrity lifetime fixes Dan Williams
     [not found] ` <20151014022841.34443.28017.stgit@dwillia2-desk3.jf.intel.com>
     [not found]   ` <alpine.LNX.2.00.1510141355250.27742@localhost.lm.intel.com>
2015-10-14 18:17     ` [PATCH 08/11] nvme: suspend i/o during runtime blk_integrity_unregister Dan Williams
2015-10-14 19:36       ` Williams, Dan J [this message]
     [not found] ` <20151014022852.34443.87630.stgit@dwillia2-desk3.jf.intel.com>
     [not found]   ` <yq1si5djcq3.fsf@sermon.lab.mkp.net>
2015-10-14 23:31     ` [PATCH 10/11] block: move blk_integrity to request_queue Dan Williams

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=1444851383.3409.3.camel@intel.com \
    --to=dan.j.williams@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 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.