On Sun, 8 Feb 2026 at 16:25, Chris Mason <[email protected]> wrote:
> Daniel Vacek <[email protected]> wrote:
> > From: Josef Bacik <[email protected]>
> >
> > We need this to make sure the appropriate encryption algorithms are
> > turned on in our config if we have FS_ENCRYPTION enabled, and
> > additionally we only support inline encryption with the fallback block
> > crypto, so we need to make sure we pull in those dependencies.
>
> Hi everyone,
>
> I'm running the btrfs for-next branch, along with the encryption patch set
> through my AI review prompts:
>
> https://github.com/masoncl/review-prompts
>
> I'm working on some btrfs specific instructions, but hopefully these reviews
> are already useful. I've kept the headers to make it easier to double check
> that I'm actually replying to the right email, but please let me know if any
> parts of this are incorrect:
>
> commit 0ab45d92f6f53371d87e1a302f09b56218d02546
> Author: Josef Bacik <[email protected]>
>
> btrfs: select encryption dependencies if FS_ENCRYPTION
>
> This commit adds select statements for encryption-related dependencies when
> FS_ENCRYPTION is enabled, including encryption algorithms, inline crypto, and
> the block layer inline encryption fallback.
>
> > diff --git a/fs/btrfs/Kconfig b/fs/btrfs/Kconfig
> > index ede184b6eda16..216a5707b099c 100644
> > --- a/fs/btrfs/Kconfig
> > +++ b/fs/btrfs/Kconfig
> > @@ -16,6 +16,9 @@ config BTRFS_FS
> > select RAID6_PQ
> > select XOR_BLOCKS
> > select XXHASH
> > + select FS_ENCRYPTION_ALGS if FS_ENCRYPTION
> > + select FS_ENCRYPTION_INLINE_CRYPT if FS_ENCRYPTION
> > + select BLK_INLINE_ENCRYPTION_FALLBACK if FS_ENCRYPTION
>
> Are the dependencies for FS_ENCRYPTION_INLINE_CRYPT and
> BLK_INLINE_ENCRYPTION_FALLBACK satisfied?
>
> Looking at fs/crypto/Kconfig:38, FS_ENCRYPTION_INLINE_CRYPT depends on
> 'FS_ENCRYPTION && BLK_INLINE_ENCRYPTION'. Similarly, in block/Kconfig:204,
> BLK_INLINE_ENCRYPTION_FALLBACK depends on 'BLK_INLINE_ENCRYPTION'.
>
> When BTRFS_FS=y with FS_ENCRYPTION=y but BLK_INLINE_ENCRYPTION=n (which is
> valid), Kconfig will generate warnings:
>
> WARNING: unmet direct dependencies detected for
> BLK_INLINE_ENCRYPTION_FALLBACK
> WARNING: unmet direct dependencies detected for FS_ENCRYPTION_INLINE_CRYPT
>
> The build will fail when compiling fs/crypto/inline_crypt.c because
> BLK_INLINE_ENCRYPTION guards the required function definitions and struct
> members:
>
> fs/crypto/inline_crypt.c:259:15: error: implicit declaration of function
> 'blk_crypto_derive_sw_secret'
> fs/crypto/inline_crypt.c:317:9: error: implicit declaration of function
> 'bio_crypt_set_ctx'
> fs/crypto/inline_crypt.c:418:45: error: 'struct bio' has no member named
> 'bi_crypt_context'
>
> Should BLK_INLINE_ENCRYPTION also be selected when FS_ENCRYPTION is enabled?
That's correct.
--- a/fs/btrfs/Kconfig
+++ b/fs/btrfs/Kconfig
@@ -18,6 +18,7 @@ config BTRFS_FS
select XXHASH
select FS_ENCRYPTION_ALGS if FS_ENCRYPTION
select FS_ENCRYPTION_INLINE_CRYPT if FS_ENCRYPTION
+ select BLK_INLINE_ENCRYPTION if FS_ENCRYPTION
select BLK_INLINE_ENCRYPTION_FALLBACK if FS_ENCRYPTION
depends on PAGE_SIZE_LESS_THAN_256KB
Thanks.
--nX
> select BLK_INLINE_ENCRYPTION if FS_ENCRYPTION
> select FS_ENCRYPTION_ALGS if FS_ENCRYPTION
> select FS_ENCRYPTION_INLINE_CRYPT if FS_ENCRYPTION
> select BLK_INLINE_ENCRYPTION_FALLBACK if FS_ENCRYPTION
>
> > depends on PAGE_SIZE_LESS_THAN_256KB
> >
> > help
>