summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2015-10-21 13:20:07 -0400
committerJens Axboe <axboe@fb.com>2015-10-21 14:43:39 -0600
commit4cfc766e07a5ed709a9d5289c8644fe78e9f24de (patch)
tree33bd0040fb645d7ab96d7b61b308bdd1c75c5041 /drivers
parentc7bfced9a6716ff66c9d61f934bb60af08d4688c (diff)
downloadlinux-4cfc766e07a5ed709a9d5289c8644fe78e9f24de.tar.bz2
nvme: suspend i/o during runtime blk_integrity_unregister
Synchronize pending i/o against a change in the integrity profile to avoid the possibility of spurious integrity errors. Cc: Matthew Wilcox <willy@linux.intel.com> Acked-by: Keith Busch <keith.busch@intel.com> [keith: also protect dynamic integrity registration] Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/nvme/host/pci.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index ad06f8dcf582..4757a2c9366e 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -2035,6 +2035,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) ||
@@ -2054,6 +2055,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;