Skip to content

Commit

Permalink
nvme: suspend i/o during runtime blk_integrity_unregister
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
djbw authored and axboe committed Oct 21, 2015
1 parent c7bfced commit 4cfc766
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/nvme/host/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) ||
Expand All @@ -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;
Expand Down

0 comments on commit 4cfc766

Please sign in to comment.