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, };