aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2024-06-13 10:48:19 +0200
committerJens Axboe <[email protected]>2024-06-14 10:20:06 -0600
commit43c5dbe98a3953e07f4fbf89aa137b9207d52378 (patch)
tree452d9117c0b3e0b01e9d264432741ec1fd82f9b1
parent1d59857ed2ec4d506e346859713c4325b5053da3 (diff)
block: don't require stable pages for non-PI metadata
Non-PI metadata doesn't contain checksums and thus doesn't require stable pages. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--block/blk-integrity.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/block/blk-integrity.c b/block/blk-integrity.c
index 58760a6d6b22..1d2d371cd632 100644
--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -379,7 +379,8 @@ void blk_integrity_register(struct gendisk *disk, struct blk_integrity *template
bi->tag_size = template->tag_size;
bi->pi_offset = template->pi_offset;
- blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, disk->queue);
+ 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) {
@@ -404,7 +405,8 @@ void blk_integrity_unregister(struct gendisk *disk)
if (!bi->tuple_size)
return;
- blk_queue_flag_clear(QUEUE_FLAG_STABLE_WRITES, disk->queue);
+ 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);