diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 20e56b0fa46a9..0deb839da0a03 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1173,6 +1173,9 @@ static void f2fs_put_super(struct super_block *sb) int i; bool dropped; + /* unregister procfs/sysfs entries in advance to avoid race case */ + f2fs_unregister_sysfs(sbi); + f2fs_quota_off_umount(sb); /* prevent remaining shrinker jobs */ @@ -1238,8 +1241,6 @@ static void f2fs_put_super(struct super_block *sb) kvfree(sbi->ckpt); - f2fs_unregister_sysfs(sbi); - sb->s_fs_info = NULL; if (sbi->s_chksum_driver) crypto_free_shash(sbi->s_chksum_driver);