Linux block layer
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Keith Busch <kbusch@meta.com>
Cc: linux-block@vger.kernel.org, linux-nvme@lists.infradead.org,
	axboe@kernel.dk, hch@lst.de, tom.leiming@gmail.com,
	coshi036@gmail.com, Igor.Achkinazi@dell.com, dlemoal@kernel.org,
	Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH RFC 4/5] block: move bio validation into __bio_split_to_limits
Date: Wed, 20 May 2026 09:25:48 +0200	[thread overview]
Message-ID: <20260520072548.GC14937@lst.de> (raw)
In-Reply-To: <20260519172326.3462354-5-kbusch@meta.com>

Replying here, but at least the high-level issue applies to the
previous patch as well.

Moving the checking from submit_bio_noacct into __bio_split_to_limits
means that we lose it for bio-based drivers except for the few that
manuall call bio_split_to_limits.  So we'll still need a helper for
them, which could be called just before calling into ->submit_bio.

> -static inline blk_status_t blk_check_zone_append(struct request_queue *q,
> -						 struct bio *bio)
> -{

Keeping a helper for this instead of doing a lot of work in a switch
statements feels nicer.

> -static blk_status_t blk_validate_atomic_write_op_size(struct request_queue *q,
> -						 struct bio *bio)
> -{
> -	if (bio->bi_iter.bi_size > queue_atomic_write_unit_max_bytes(q))
> -		return BLK_STS_INVAL;
> -
> -	if (bio->bi_iter.bi_size % queue_atomic_write_unit_min_bytes(q))
> -		return BLK_STS_INVAL;
> -
> -	return BLK_STS_OK;
> -}

Similar for this one.


  reply	other threads:[~2026-05-20  7:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19 17:23 [PATCH RFC 0/5] block: validate bios against queue limits in the entered context Keith Busch
2026-05-19 17:23 ` [PATCH RFC 1/5] blk-mq: fix status for unaligned bio Keith Busch
2026-05-20  6:56   ` Damien Le Moal
2026-05-20  7:22   ` Christoph Hellwig
2026-05-20 19:54     ` Chao S
2026-05-19 17:23 ` [PATCH RFC 2/5] block: fix invalid zone append status Keith Busch
2026-05-20  6:58   ` Damien Le Moal
2026-05-20  7:23   ` Christoph Hellwig
2026-05-19 17:23 ` [PATCH RFC 3/5] block: validate bio bounds in the queue entered context Keith Busch
2026-05-20  7:22   ` Damien Le Moal
2026-05-20  7:25     ` Damien Le Moal
2026-05-19 17:23 ` [PATCH RFC 4/5] block: move bio validation into __bio_split_to_limits Keith Busch
2026-05-20  7:25   ` Christoph Hellwig [this message]
2026-05-20 15:19     ` Keith Busch
2026-05-19 17:23 ` [PATCH RFC 5/5] block, nvme: add failed_bio callback for multipath bio failover Keith Busch
2026-05-20  7:27   ` Christoph Hellwig
2026-05-20 15:07     ` Keith Busch
2026-05-20 15:26       ` Keith Busch

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=20260520072548.GC14937@lst.de \
    --to=hch@lst.de \
    --cc=Igor.Achkinazi@dell.com \
    --cc=axboe@kernel.dk \
    --cc=coshi036@gmail.com \
    --cc=dlemoal@kernel.org \
    --cc=kbusch@kernel.org \
    --cc=kbusch@meta.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=tom.leiming@gmail.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