Re: [PATCH] nilfs2: fix backing_dev_info reference leak
From: Viacheslav Dubeyko
Date: Fri May 08 2026 - 14:10:02 EST
On Fri, 2026-05-08 at 11:05 +0900, Ryusuke Konishi wrote:
> On Fri, May 8, 2026 at 6:41 AM Viacheslav Dubeyko wrote:
> >
> > On Thu, 2026-05-07 at 11:50 -0400, Shuangpeng Bai wrote:
> > > setup_bdev_super() already initializes sb->s_bdev and takes a
> > > reference on the block device backing_dev_info when assigning sb->s_bdi.
> > >
> > > nilfs_fill_super() takes another reference to the same
> > > backing_dev_info and stores it in sb->s_bdi again. The extra
> > > reference is not paired with a matching bdi_put(), since
> > > generic_shutdown_super() releases sb->s_bdi only once.
> > >
> > > Drop the redundant bdi_get() in nilfs_fill_super(). The single
> > > reference taken by setup_bdev_super() is enough and is released
> > > during superblock shutdown.
> > >
> > > Fixes: c1e012ea9e83 ("nilfs2: use setup_bdev_super to de-duplicate the mount code")
> > > Signed-off-by: Shuangpeng Bai <shuangpeng.kernel@xxxxxxxxx>
> > > ---
> > > fs/nilfs2/super.c | 2 --
> > > 1 file changed, 2 deletions(-)
>
> Acked-by: Ryusuke Konishi <konishi.ryusuke@xxxxxxxxx>
>
> Viacheslav,
>
> Could you please apply this directly?
> I have also verified the fix and confirmed that the Fixes tag
> correctly identifies the origin of the leak for backporting.
>
Applied.
Thanks,
Slava.