From: Keith Busch <kbusch@kernel.org>
To: Ming Lei <ming.lei@redhat.com>
Cc: Mikulas Patocka <mpatocka@redhat.com>,
Mike Snitzer <snitzer@kernel.org>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, dm-devel@lists.linux.dev
Subject: Re: block: fail unaligned bio from submit_bio_noacct()
Date: Thu, 21 Mar 2024 20:39:06 -0600 [thread overview]
Message-ID: <ZfzvSguRii37MErS@kbusch-mbp> (raw)
In-Reply-To: <ZfzoC/V07nExJ+0x@fedora>
On Fri, Mar 22, 2024 at 10:08:11AM +0800, Ming Lei wrote:
> On Thu, Mar 21, 2024 at 06:01:41PM +0100, Mikulas Patocka wrote:
> > I would change it to
> >
> > if (unlikely(((bi_iter.bi_sector | bio_sectors(bio)) & ((queue_logical_block_size(q) >> 9) - 1)) != 0))
> > return false;
>
> What if bio->bi_iter.bi_size isn't aligned with 512? The above check
> can't find that at all.
Shouldn't that mean this check doesn't apply to REQ_OP_DRV_IN/OUT?
Those ops don't necessarily imply any alignment requirements. It may not
matter here since it looks like all existing users go through
blk_execute_rq() instead of submit_bio(), but there are other checks for
DRV_IN/OUT in this path, so I guess it is supposed to be supported?
next prev parent reply other threads:[~2024-03-22 2:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-21 13:16 [PATCH] block: fail unaligned bio from submit_bio_noacct() Ming Lei
2024-03-21 15:14 ` Bart Van Assche
2024-03-21 15:18 ` Ming Lei
2024-03-21 15:43 ` Mike Snitzer
2024-03-21 17:01 ` Mikulas Patocka
2024-03-21 22:07 ` Christoph Hellwig
2024-03-22 2:08 ` Ming Lei
2024-03-22 2:39 ` Keith Busch [this message]
2024-03-24 8:02 ` Ming Lei
2024-03-22 10:16 ` Mikulas Patocka
2024-03-21 17:09 ` [PATCH] " Jens Axboe
2024-03-21 22:09 ` Christoph Hellwig
2024-03-21 22:50 ` Jens Axboe
2024-03-22 0:31 ` Christoph Hellwig
2024-03-22 1:21 ` Ming Lei
2024-03-21 22:06 ` Christoph Hellwig
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=ZfzvSguRii37MErS@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=axboe@kernel.dk \
--cc=dm-devel@lists.linux.dev \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=mpatocka@redhat.com \
--cc=snitzer@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).