Re: [PATCH v2 4/6] efivarfs: move freeing of variable entry into evict_inode

James Bottomley
2025-01-16T19:05:33Z

On Thu, 2025-01-16 at 18:36 +0000, Al Viro wrote:
> On Mon, Jan 06, 2025 at 06:35:23PM -0800, James Bottomley wrote:
> > Make the inodes the default management vehicle for struct
> > efivar_entry, so they are now all freed automatically if the file
> > is removed and on unmount in kill_litter_super().  Remove the now
> > superfluous iterator to free the entries after kill_litter_super().
> >
> > Also fixes a bug where some entry freeing was missing causing
> > efivarfs to leak memory.
>
> Umm...  I'd rather coallocate struct inode and struct efivar_entry;
> that way once you get rid of the list you don't need ->evict_inode()
> anymore.
>
> It's pretty easy - see e.g.
> https://lore.kernel.org/all/20250112080705.141166-1-viro@zeniv.linux.org.uk/
> for recent example of such conversion.

OK, I can do that. Although I think since the number of variables is
usually around 150, it would probably be overkill to give it its own
inode cache allocator.

Regards,

James