Re:

Al Viro
2025-11-18T17:40:06Z

On Tue, Nov 18, 2025 at 07:27:06PM +0100, Mehdi Ben Hadj Khelifa wrote:
> #syz test
>
> diff --git a/fs/hfs/super.c b/fs/hfs/super.c
> index 47f50fa555a4..46cdff89fb00 100644
> --- a/fs/hfs/super.c
> +++ b/fs/hfs/super.c
> @@ -431,10 +431,21 @@ static int hfs_init_fs_context(struct fs_context *fc)
> return 0;
> }
>
> +static void hfs_kill_sb(struct super_block *sb)
> +{
> + generic_shutdown_super(sb);
> + hfs_mdb_put(sb);
> + if (sb->s_bdev) {
> + sync_blockdev(sb->s_bdev);
> + bdev_fput(sb->s_bdev_file);
> + }
> +
> +}
> +
> static struct file_system_type hfs_fs_type = {
> .owner = THIS_MODULE,
> .name = "hfs",
> - .kill_sb = kill_block_super,
> + .kill_sb = hfs_kill_sb,
> .fs_flags = FS_REQUIRES_DEV,
> .init_fs_context = hfs_init_fs_context,
> };

Remove the calls of hfs_mdb_put() from hfs_fill_super() and
hfs_put_super() in addition to that.