Skip to content

Commit cc8f7fe

Browse files
Haimin Zhangaxboe
authored andcommitted
block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern
Add __GFP_ZERO flag for alloc_page in function bio_copy_kern to initialize the buffer of a bio. Signed-off-by: Haimin Zhang <tcs.kernel@gmail.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20220216084038.15635-1-tcs.kernel@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 06582bc commit cc8f7fe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

block/blk-map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ static struct bio *bio_copy_kern(struct request_queue *q, void *data,
446446
if (bytes > len)
447447
bytes = len;
448448

449-
page = alloc_page(GFP_NOIO | gfp_mask);
449+
page = alloc_page(GFP_NOIO | __GFP_ZERO | gfp_mask);
450450
if (!page)
451451
goto cleanup;
452452

0 commit comments

Comments
 (0)