Skip to content

Commit

Permalink
block: don't require stable pages for non-PI metadata
Browse files Browse the repository at this point in the history
Non-PI metadata doesn't contain checksums and thus doesn't require
stable pages.

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-10-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Jun 14, 2024
1 parent 1d59857 commit 43c5dbe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions block/blk-integrity.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);

0 comments on commit 43c5dbe

Please sign in to comment.