On Fri, 22 May 2026 at 11:19, Christoph Hellwig <[email protected]> wrote: > On Wed, May 13, 2026 at 10:52:51AM +0200, Daniel Vacek wrote: > > From: Sweet Tea Dorminy <[email protected]> > > > > Since extent encryption requires inline encryption, even though we > > expect to use the inlinecrypt software fallback most of the time, we > > need to enumerate all the devices in use by btrfs. > > How does this handled adding/removing devices at runtime?
When called, this callback returns the list of bdevs opened by the given superblock. If devices are added or removed, this function returns a different list. In other words it always returns a valid list. This is called from `fscrypt_get_devices()`, which is called from `fscrypt_select_encryption_impl()` or `fscrypt_prepare_inline_crypt_key()` or `fscrypt_destroy_inline_crypt_key()`. All these functions walk the returned list and discard it immediately afterwards. Note that with btrfs at this point we're only using the inline crypto fallback. Is there any particular reason you asked this question? --nX

