From: Eric Biggers <ebiggers@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Bart Van Assche <bvanassche@acm.org>,
Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org
Subject: Re: [PATCH v2 2/2] block: Rework splitting of encrypted bios
Date: Mon, 14 Jul 2025 23:11:17 -0700 [thread overview]
Message-ID: <20250715061117.GA595531@sol> (raw)
In-Reply-To: <20250715053735.GA18120@lst.de>
On Tue, Jul 15, 2025 at 07:37:35AM +0200, Christoph Hellwig wrote:
> On Tue, Jul 15, 2025 at 02:18:10AM +0000, Eric Biggers wrote:
> > On Fri, Jul 11, 2025 at 10:18:52AM -0700, Bart Van Assche wrote:
> > > @@ -124,9 +125,13 @@ static struct bio *bio_submit_split(struct bio *bio, int split_sectors)
> > > trace_block_split(split, bio->bi_iter.bi_sector);
> > > WARN_ON_ONCE(bio_zone_write_plugging(bio));
> > > submit_bio_noacct(bio);
> > > - return split;
> > > +
> > > + bio = split;
> > > }
> > >
> > > + if (unlikely(!blk_crypto_bio_prep(&bio)))
> > > + return NULL;
> >
> > Is this reached for every bio for every block device?
>
> No.
>
> > If not, then this
> > patch causes data to sometimes be left unencrypted when the submitter of
> > the bio provided an encryption context, which isn't okay.
>
> I agree, but I think the root problem is the blind assumption that
> everything can encrypt. That is a huge mistake and really limits the
> block layer. I think we need to fix that first and tell the upper
> layers what can encrypt, including using the fallback where we think
> it is suitable.
I've actually been thinking of going in the other direction: dropping
the support for fs-layer file contents encryption from ext4 and f2fs,
and instead just relying on blk-crypto. That would simplify ext4 and
f2fs quite a bit, as they'd then have just one file contents encryption
code path to support. Also, blk-crypto "just works" with large folios,
whereas the fs-layer code doesn't support large folios yet.
But that will only work if blk-crypto-fallback continues to support all
block devices.
So, effectively you are advocating for keeping the fs-layer file
contents encryption code in ext4 and f2fs forever?
- Eric
next prev parent reply other threads:[~2025-07-15 6:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 17:18 [PATCH v2 0/2] Fix bio splitting in the crypto fallback code Bart Van Assche
2025-07-11 17:18 ` [PATCH v2 1/2] block: Split blk_crypto_fallback_split_bio_if_needed() Bart Van Assche
2025-07-14 11:29 ` Christoph Hellwig
2025-07-14 13:48 ` John Garry
2025-07-14 15:35 ` Bart Van Assche
2025-07-15 5:40 ` Christoph Hellwig
2025-07-11 17:18 ` [PATCH v2 2/2] block: Rework splitting of encrypted bios Bart Van Assche
2025-07-15 2:18 ` Eric Biggers
2025-07-15 5:37 ` Christoph Hellwig
2025-07-15 6:11 ` Eric Biggers [this message]
2025-07-15 6:21 ` Christoph Hellwig
2025-07-16 1:39 ` Damien Le Moal
2025-07-15 5:44 ` Christoph Hellwig
2025-07-14 11:35 ` [PATCH v2 0/2] Fix bio splitting in the crypto fallback code Christoph Hellwig
2025-07-14 15:37 ` Bart Van Assche
2025-07-15 2:05 ` Martin K. Petersen
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=20250715061117.GA595531@sol \
--to=ebiggers@kernel.org \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=linux-block@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.