From: Shuangpeng Bai Date: Thu, 7 May 2026 15:50:21 +0000 (-0400) Subject: nilfs2: fix backing_dev_info reference leak X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=665f192a2a11384cb7dc1be5f87d16438522a4ed;p=thirdparty%2Fkernel%2Flinux.git nilfs2: fix backing_dev_info reference leak 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 Acked-by: Ryusuke Konishi Reviewed-by: Viacheslav Dubeyko Signed-off-by: Viacheslav Dubeyko --- diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 7aa5ef8606cdd..893a504cb80c8 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c @@ -1070,8 +1070,6 @@ nilfs_fill_super(struct super_block *sb, struct fs_context *fc) sb->s_time_gran = 1; sb->s_max_links = NILFS_LINK_MAX; - sb->s_bdi = bdi_get(sb->s_bdev->bd_disk->bdi); - err = load_nilfs(nilfs, sb); if (err) goto failed_nilfs;