Commit c546d6f4 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

block: only zero non-PI metadata tuples in bio_integrity_prep



The PI generation helpers already zero the app tag, so relax the zeroing
to non-PI metadata.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarKanchan Joshi <joshi.k@samsung.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20240626045950.189758-2-hch@lst.de


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f1e46758
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -456,10 +456,10 @@ bool bio_integrity_prep(struct bio *bio)

		/*
		 * Zero the memory allocated to not leak uninitialized kernel
		 * memory to disk.  For PI this only affects the app tag, but
		 * for non-integrity metadata it affects the entire metadata
		 * buffer.
		 * memory to disk for non-integrity metadata where nothing else
		 * initializes the memory.
		 */
		if (bi->csum_type == BLK_INTEGRITY_CSUM_NONE)
			gfp |= __GFP_ZERO;
	}