From: Eric Biggers <ebiggers@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>,
Bart Van Assche <bvanassche@acm.org>,
Damien Le Moal <dlemoal@kernel.org>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, Yu Kuai <yukuai1@huaweicloud.com>,
Ming Lei <ming.lei@redhat.com>,
Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Subject: Re: [PATCH 1/2] block: Make __submit_bio_noacct() preserve the bio submission order
Date: Tue, 10 Jun 2025 21:21:48 -0700 [thread overview]
Message-ID: <20250611042148.GC1484147@sol> (raw)
In-Reply-To: <20250611034031.GA2704@lst.de>
On Wed, Jun 11, 2025 at 05:40:31AM +0200, Christoph Hellwig wrote:
> On Tue, Jun 10, 2025 at 05:18:03PM -0600, Keith Busch wrote:
> > I think you could just prep the encryption at the point the bio is split
> > to its queue's limits, and then all you need to do after that is ensure
> > the limits don't exceed what the fallback requires (which appears to
> > just be a simple segment limitation). It looks like most of the bio
> > based drivers split to limits already.
>
> I'm still a bit confused about the interaction of block-crypto and
> stacking drivers. For native support you obviously always want to pass
> the crypt context down to the lowest level hardware driver, and dm
> has code to support this. But if you stacking driver is not dm, or
> the algorithm is not supported by the underlying hardware it looks
> like we might still be able to run the fallback for a stacking
> driver. Or am I missing something here? Eric/Bart: any chance to
> get blktests (or xfstets if that's easier to wire up) to exercise all
> these corner cases?
blk-crypto-fallback runs at the top layer, so yes it's different from native
inline encryption support where the encryption is done at the bottom. (But the
results are the same from the filesystem's perspective, since native support
only gets passed through and used when it would give the expected result.)
If it helps, blk-crypto-fallback can be exercised by running the "encrypt" group
of xfstests on ext4 or f2fs with "inlinecrypt" added to the mount options.
These include tests that the data on-disk is actually encrypted correctly.
But that probably doesn't help much here, where the issue is with bio splitting.
It's been a while since I looked at blk-crypto-fallback. But the reason that it
does splitting is because it has to replace the data with encrypted data, and it
allocates encrypted bounce pages individually which each needs its own bio_vec.
Therefore, if the bio is longer than BIO_MAX_VECS pages, it has to be split.
If the splitting to stay within BIO_MAX_VECS pages could be done before
blk-crypto-fallback is given the bio instead, that should work fine too.
Just keep in mind that blk-crypto-fallback is meant to work on any block device
(even ones that don't have a crypto profile, as the profile is just for the
native support). So we do need to make sure it always gets invoked when needed.
- Eric
next prev parent reply other threads:[~2025-06-11 4:22 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 20:29 [PATCH 0/2] Two bug fixes for zoned block devices Bart Van Assche
2025-05-14 20:29 ` [PATCH 1/2] block: Make __submit_bio_noacct() preserve the bio submission order Bart Van Assche
2025-05-15 7:19 ` Niklas Cassel
2025-05-15 15:58 ` Bart Van Assche
2025-05-16 4:47 ` Christoph Hellwig
2025-05-19 22:12 ` Bart Van Assche
2025-05-20 13:56 ` Christoph Hellwig
2025-05-20 18:09 ` Bart Van Assche
2025-05-21 5:53 ` Christoph Hellwig
2025-05-21 21:18 ` Bart Van Assche
2025-05-22 5:12 ` Damien Le Moal
2025-05-22 17:08 ` Bart Van Assche
2025-05-23 6:02 ` Damien Le Moal
2025-05-23 16:30 ` Bart Van Assche
2025-05-24 8:48 ` Damien Le Moal
2025-05-24 14:05 ` Bart Van Assche
2025-05-24 15:36 ` Damien Le Moal
2025-05-26 5:24 ` Christoph Hellwig
2025-05-27 16:19 ` Bart Van Assche
2025-05-31 0:25 ` Bart Van Assche
2025-06-08 22:07 ` Bart Van Assche
2025-06-08 22:47 ` Damien Le Moal
2025-06-09 3:58 ` Christoph Hellwig
2025-06-09 20:48 ` Bart Van Assche
2025-06-10 5:04 ` Christoph Hellwig
2025-06-09 3:55 ` Christoph Hellwig
2025-06-10 17:23 ` Bart Van Assche
2025-06-10 23:18 ` Keith Busch
2025-06-11 0:46 ` Damien Le Moal
2025-06-11 1:00 ` Keith Busch
2025-06-11 1:02 ` Damien Le Moal
2025-06-11 1:08 ` Keith Busch
2025-06-11 1:34 ` Keith Busch
2025-06-11 3:40 ` Christoph Hellwig
2025-06-11 4:21 ` Eric Biggers [this message]
2025-06-11 16:15 ` Bart Van Assche
2025-06-11 18:15 ` Eric Biggers
2025-06-11 19:43 ` Bart Van Assche
2025-06-18 22:27 ` Bart Van Assche
2025-05-23 4:21 ` Christoph Hellwig
2025-05-14 20:29 ` [PATCH 2/2] block: Fix a deadlock related freezing zoned storage devices Bart Van Assche
2025-05-16 4:51 ` Christoph Hellwig
2025-05-19 22:22 ` Bart Van Assche
2025-05-20 13:57 ` 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=20250611042148.GC1484147@sol \
--to=ebiggers@kernel.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=dlemoal@kernel.org \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=shinichiro.kawasaki@wdc.com \
--cc=yukuai1@huaweicloud.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