Re: [PATCH 03/16] blk-crypto: Allow control over whether hardware is used

Christoph Hellwig <[email protected]> Fri, 26 Jun 2026 07:18:19 +0200
Newsgroups org.kernel.vger.linux-fscrypt,net.sourceforge.lists.linux-f2fs-devel,org.kernel.vger.linux-block,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
On Tue, Jun 23, 2026 at 10:03:21PM -0700, Eric Biggers wrote:
> fscrypt uses inline encryption hardware only when the "inlinecrypt"
> mount option is given.  I'd like to keep that behavior even after
> standardizing on the blk-crypto API for file contents encryption.  That
> is, the default should continue to be the well-tested CPU-based
> encryption code, and the use of inline encryption hardware should
> continue to be an opt-in feature for systems where it's beneficial and
> has been fully validated (including verifying ciphertext correctness).
> 
> To support this use case, add an allow_hw field to struct
> blk_crypto_config.
> 
> For now it's always set to true.  Later commits will change that.

Maybe a flags argument with a descriptive flag name would be better
than a bool for a public API like this?

Otherwise looks good:

Reviewed-by: Christoph Hellwig <[email protected]>