Skip to content

Commit 43c5dbe

Browse files
Christoph Hellwigaxboe
authored andcommitted
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]>
1 parent 1d59857 commit 43c5dbe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

block/blk-integrity.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,8 @@ void blk_integrity_register(struct gendisk *disk, struct blk_integrity *template
379379
bi->tag_size = template->tag_size;
380380
bi->pi_offset = template->pi_offset;
381381

382-
blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, disk->queue);
382+
if (bi->csum_type != BLK_INTEGRITY_CSUM_NONE)
383+
blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, disk->queue);
383384

384385
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
385386
if (disk->queue->crypto_profile) {
@@ -404,7 +405,8 @@ void blk_integrity_unregister(struct gendisk *disk)
404405
if (!bi->tuple_size)
405406
return;
406407

407-
blk_queue_flag_clear(QUEUE_FLAG_STABLE_WRITES, disk->queue);
408+
if (bi->csum_type != BLK_INTEGRITY_CSUM_NONE)
409+
blk_queue_flag_clear(QUEUE_FLAG_STABLE_WRITES, disk->queue);
408410
memset(bi, 0, sizeof(*bi));
409411
}
410412
EXPORT_SYMBOL(blk_integrity_unregister);

0 commit comments

Comments
 (0)