aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <[email protected]>2024-06-26 06:59:34 +0200
committerJens Axboe <[email protected]>2024-06-28 10:29:41 -0600
commitc546d6f438338017480d105ab597292da67f6f6a (patch)
treec6fd16d64320dd44d3ac600e56a1eb24bd024fd0
parentf1e46758e8b2b04c725ac706b5f455c0de0486a4 (diff)
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 <[email protected]> Reviewed-by: Kanchan Joshi <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--block/bio-integrity.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 356ca0d3d62f..4da003b86a1b 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -456,11 +456,11 @@ 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.
*/
- gfp |= __GFP_ZERO;
+ if (bi->csum_type == BLK_INTEGRITY_CSUM_NONE)
+ gfp |= __GFP_ZERO;
}
/* Allocate kernel buffer for protection data */