erofs: call erofs_exit_ishare() before rcu_barrier()

Ensure all inode free callbacks have completed before
destroying the inode slab cache.

Fixes: 5ef3208e3b ("erofs: introduce the page cache share feature")
Reviewed-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
This commit is contained in:
Gao Xiang 2026-06-17 11:14:59 +08:00
parent b05fb89900
commit 289cf458a6

View File

@ -1048,11 +1048,11 @@ static int __init erofs_module_init(void)
static void __exit erofs_module_exit(void)
{
unregister_filesystem(&erofs_fs_type);
erofs_exit_ishare();
/* Ensure all RCU free inodes / pclusters are safe to be destroyed. */
/* ensure all delayed rcu free inodes & pclusters are flushed */
rcu_barrier();
erofs_exit_ishare();
erofs_exit_sysfs();
z_erofs_exit_subsystem();
erofs_exit_shrinker();