diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 6f6368400ee4..08fe8fa95924 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -4634,9 +4634,6 @@ static int __init init_f2fs_fs(void) err = register_shrinker(&f2fs_shrinker_info); if (err) goto free_sysfs; - err = register_filesystem(&f2fs_fs_type); - if (err) - goto free_shrinker; f2fs_create_root_stats(); err = f2fs_init_post_read_processing(); if (err) @@ -4660,6 +4657,7 @@ static int __init init_f2fs_fs(void) if (err) goto free_compress_cache; err = f2fs_init_xattr_cache(); + err = register_filesystem(&f2fs_fs_type); if (err) goto free_casefold_cache; return 0; @@ -4679,8 +4677,6 @@ static int __init init_f2fs_fs(void) f2fs_destroy_post_read_processing(); free_root_stats: f2fs_destroy_root_stats(); - unregister_filesystem(&f2fs_fs_type); -free_shrinker: unregister_shrinker(&f2fs_shrinker_info); free_sysfs: f2fs_exit_sysfs(); @@ -4704,6 +4700,7 @@ static int __init init_f2fs_fs(void) static void __exit exit_f2fs_fs(void) { + unregister_filesystem(&f2fs_fs_type); f2fs_destroy_xattr_cache(); f2fs_destroy_casefold_cache(); f2fs_destroy_compress_cache(); @@ -4713,7 +4710,6 @@ static void __exit exit_f2fs_fs(void) f2fs_destroy_iostat_processing(); f2fs_destroy_post_read_processing(); f2fs_destroy_root_stats(); - unregister_filesystem(&f2fs_fs_type); unregister_shrinker(&f2fs_shrinker_info); f2fs_exit_sysfs(); f2fs_destroy_garbage_collection_cache();