mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
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: Christoph Hellwig <hch@lst.de> Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20240626045950.189758-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
f1e46758e8
commit
c546d6f438
|
|
@ -456,11 +456,11 @@ bool bio_integrity_prep(struct bio *bio)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Zero the memory allocated to not leak uninitialized kernel
|
* Zero the memory allocated to not leak uninitialized kernel
|
||||||
* memory to disk. For PI this only affects the app tag, but
|
* memory to disk for non-integrity metadata where nothing else
|
||||||
* for non-integrity metadata it affects the entire metadata
|
* initializes the memory.
|
||||||
* buffer.
|
|
||||||
*/
|
*/
|
||||||
gfp |= __GFP_ZERO;
|
if (bi->csum_type == BLK_INTEGRITY_CSUM_NONE)
|
||||||
|
gfp |= __GFP_ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate kernel buffer for protection data */
|
/* Allocate kernel buffer for protection data */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user