Skip to contentSkip to conversation

block/bio: Do not zero user pages

PATCH In review Keith Busch 2 participants 2 messages Dec 10, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block/bio: Do not zero user pages

We don't need to zero fill the bio if not using kernel allocated pages.

Fixes f3587d76da05 ("block: Clear kernel memory before copying to user") # v4.20-rc2
Cc Laurence Oberman <[email protected]>
Cc Bart Van Assche <[email protected]>
---
 block/bio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
block/bio.c +2 -1
index c4ef8aa46452..55a5386fd431 100644
@@ -1262,7 +1262,8 @@ struct bio *bio_copy_user_iov(struct request_queue *q,
 		if (ret)
 			goto cleanup;
 	} else {
-		zero_fill_bio(bio);
+		if (bmd->is_our_pages)
+			zero_fill_bio(bio);
 		iov_iter_advance(iter, bio->bi_iter.bi_size);
 	}
 
Signature · 1 line
2.13.6
maintainer
#1 lore raw
Quoted 1 line · Keith Busch

We don't need to zero fill the bio if not using kernel allocated pages.

Applied, thanks Keith. I added Laurence's Tested-by to the commit.

Signature · 1 line
Jens Axboe