The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Chaohai Chen <wdhh6@aliyun.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: remove the boring judgment in blk_rq_map_bio_alloc()
Date: Thu, 15 Jan 2026 10:18:33 -0700	[thread overview]
Message-ID: <2d73aaa4-9718-4285-ab3f-85e1fa3b40fa@kernel.dk> (raw)
In-Reply-To: <20260115114356.4167248-1-wdhh6@aliyun.com>

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

  reply	other threads:[~2026-01-15 17:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 11:43 [PATCH] block: remove the boring judgment in blk_rq_map_bio_alloc() Chaohai Chen
2026-01-15 17:18 ` Jens Axboe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-01-16  2:15 Chaohai Chen
2026-01-16  3:40 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d73aaa4-9718-4285-ab3f-85e1fa3b40fa@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wdhh6@aliyun.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox