summaryrefslogtreecommitdiff
path: root/block/blk-integrity.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-06-13 10:48:20 +0200
committerJens Axboe <axboe@kernel.dk>2024-06-14 10:20:06 -0600
commit3c3e85ddffae93eba1a257eb6939bf5dc1e93b9e (patch)
treeb69e5827ba95b9079e2d89e05b30ddb0fcf6a193 /block/blk-integrity.c
parent43c5dbe98a3953e07f4fbf89aa137b9207d52378 (diff)
block: bypass the STABLE_WRITES flag for protection information
Currently registering a checksum-enabled (aka PI) integrity profile sets the QUEUE_FLAG_STABLE_WRITE flag, and unregistering it clears the flag. This can incorrectly clear the flag when the driver requires stable writes even without PI, e.g. in case of iSCSI or NVMe/TCP with data digest enabled. Fix this by looking at the csum_type directly in bdev_stable_writes and not setting the queue flag. Also remove the blk_queue_stable_writes helper as the only user in nvme wants to only look at the actual QUEUE_FLAG_STABLE_WRITE flag as it inherits the integrity configuration by other means. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20240613084839.1044015-11-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-integrity.c')
-rw-r--r--block/blk-integrity.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/block/blk-integrity.c b/block/blk-integrity.c
index 1d2d371cd632..bec0d1df387c 100644
--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -379,9 +379,6 @@ void blk_integrity_register(struct gendisk *disk, struct blk_integrity *template
bi->tag_size = template->tag_size;
bi->pi_offset = template->pi_offset;
- if (bi->csum_type != BLK_INTEGRITY_CSUM_NONE)
- blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, disk->queue);
-
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
if (disk->queue->crypto_profile) {
pr_warn("blk-integrity: Integrity and hardware inline encryption are not supported together. Disabling hardware inline encryption.\n");
@@ -404,9 +401,6 @@ void blk_integrity_unregister(struct gendisk *disk)
if (!bi->tuple_size)
return;
-
- if (bi->csum_type != BLK_INTEGRITY_CSUM_NONE)
- blk_queue_flag_clear(QUEUE_FLAG_STABLE_WRITES, disk->queue);
memset(bi, 0, sizeof(*bi));
}
EXPORT_SYMBOL(blk_integrity_unregister);