Re: [PATCH] fscrypt: Avoid dynamic allocation in fscrypt_get_devices()

Christoph Hellwig <[email protected]> Mon, 20 Jul 2026 02:23:34 -0700
Newsgroups org.kernel.vger.linux-fscrypt,net.sourceforge.lists.linux-f2fs-devel,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <[email protected]>
On Sat, Jul 18, 2026 at 10:56:02PM -0700, Eric Biggers wrote:
> For now, let's fix this in the straightforward and easily-backportable
> way by switching to an on-stack array.  Currently the fscrypt
> multi-device functionality is used only by f2fs, which has a hardcoded
> limit of 8 block devices.  An on-stack array works fine for that.

Looks fine as a quick fix:

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

> (Of course, this solution won't scale up to large number of block
> devices.  For that we'd need a different solution, like moving the block
> device iteration into the filesystem.

I'd love to see this happen rather sooner than later, as that's a much
better architecture.