Skip to content

Commit 4cfc766

Browse files
djbwaxboe
authored andcommitted
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 <[email protected]> Acked-by: Keith Busch <[email protected]> [keith: also protect dynamic integrity registration] Signed-off-by: Dan Williams <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent c7bfced commit 4cfc766

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/nvme/host/pci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,6 +2035,7 @@ static int nvme_revalidate_disk(struct gendisk *disk)
20352035
pi_type = ns->ms == sizeof(struct t10_pi_tuple) ?
20362036
id->dps & NVME_NS_DPS_PI_MASK : 0;
20372037

2038+
blk_mq_freeze_queue(disk->queue);
20382039
if (blk_get_integrity(disk) && (ns->pi_type != pi_type ||
20392040
ns->ms != old_ms ||
20402041
bs != queue_logical_block_size(disk->queue) ||
@@ -2054,6 +2055,7 @@ static int nvme_revalidate_disk(struct gendisk *disk)
20542055

20552056
if (dev->oncs & NVME_CTRL_ONCS_DSM)
20562057
nvme_config_discard(ns);
2058+
blk_mq_unfreeze_queue(disk->queue);
20572059

20582060
kfree(id);
20592061
return 0;

0 commit comments

Comments
 (0)