lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2d73aaa4-9718-4285-ab3f-85e1fa3b40fa@kernel.dk>
Date: Thu, 15 Jan 2026 10:18:33 -0700
From: Jens Axboe <axboe@...nel.dk>
To: Chaohai Chen <wdhh6@...yun.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] block: remove the boring judgment in
 blk_rq_map_bio_alloc()

On 1/15/26 4:43 AM, Chaohai Chen wrote:
> There is no need to check the return value of bio_alloc_bioset().

Boring judgement? I'm very confused, what on earth does that mean.

> diff --git a/block/blk-map.c b/block/blk-map.c
> index 4533094d9458..f95b07ec3b88 100644
> --- a/block/blk-map.c
> +++ b/block/blk-map.c
> @@ -46,14 +46,8 @@ static struct bio *blk_rq_map_bio_alloc(struct request *rq,
>  		unsigned int nr_vecs, gfp_t gfp_mask)
>  {
>  	struct block_device *bdev = rq->q->disk ? rq->q->disk->part0 : NULL;
> -	struct bio *bio;
>  
> -	bio = bio_alloc_bioset(bdev, nr_vecs, rq->cmd_flags, gfp_mask,
> -				&fs_bio_set);
> -	if (!bio)
> -		return NULL;
> -
> -	return bio;
> +	return bio_alloc_bioset(bdev, nr_vecs, rq->cmd_flags, gfp_mask, &fs_bio_set);
>  }

Presumably this means that nobody ever calls blk_rq_map_bio_alloc()
without __GFP_WAIT set in gfp_mask? Because otherwise this would be
broken. And this then further means that this should most likely be
checked.

All of this is absent from the commit message, which has zero details.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ