Re: [PATCH v7 05/43] blk-crypto: add a process bio callback

Eric Biggers <[email protected]> Mon, 1 Jun 2026 19:48:49 -0700
Newsgroups org.kernel.vger.linux-fscrypt,org.kernel.vger.linux-block,org.kernel.vger.linux-btrfs,org.kernel.vger.linux-kernel
Message-ID <20260602024849.GE2295@sol>
On Wed, May 13, 2026 at 10:52:39AM +0200, Daniel Vacek wrote:
>  /*
>   * Supported types of keys.  Must be bitflags due to their use in
>   * blk_crypto_profile::key_types_supported.
> @@ -77,12 +85,14 @@ enum blk_crypto_key_type {
>   *	filesystem block size or the disk sector size.
>   * @dun_bytes: the maximum number of bytes of DUN used when using this key
>   * @key_type: the type of this key -- either raw or hardware-wrapped
> + * @proces_bio: optional callback to process encrypted bios.
>   */
>  struct blk_crypto_config {
>  	enum blk_crypto_mode_num crypto_mode;
>  	unsigned int data_unit_size;
>  	unsigned int dun_bytes;
>  	enum blk_crypto_key_type key_type;
> +	blk_crypto_process_bio_t process_bio;
>  };

This new field needs to be initialized in
fscrypt_select_encryption_impl().  Otherwise it breaks native inline
encryption for ext4 and f2fs.

- Eric