From 5ac9b91c6d96d260d7bc0773bd81177f7a53ea61 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Sun, 24 Nov 2024 00:23:47 +0100 Subject: [PATCH] Revert "block: initialize integrity buffer to zero before writing it to media" This reverts commit 9e8e62c4a8bad5d285d07cf4219c33792fa797a0. --- block/bio-integrity.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index a5fd04db5..a4cfc9727 100755 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -216,7 +216,6 @@ bool bio_integrity_prep(struct bio *bio) unsigned int bytes, offset, i; unsigned int intervals; blk_status_t status; - gfp_t gfp = GFP_NOIO; if (!bi) return true; @@ -239,20 +238,12 @@ bool bio_integrity_prep(struct bio *bio) if (!bi->profile->generate_fn || !(bi->flags & BLK_INTEGRITY_GENERATE)) return true; - - /* - * 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. - */ - gfp |= __GFP_ZERO; } intervals = bio_integrity_intervals(bi, bio_sectors(bio)); /* Allocate kernel buffer for protection data */ len = intervals * bi->tuple_size; - buf = kmalloc(len, gfp | q->bounce_gfp); + buf = kmalloc(len, GFP_NOIO | q->bounce_gfp); status = BLK_STS_RESOURCE; if (unlikely(buf == NULL)) { printk(KERN_ERR "could not allocate integrity buffer\n");