synchronize_rcu() does not wait for in-flight rcu callback completion,
thus kmem_cache_free() can still race with kmem_cache_destroy().
Fixes:
a9411a9856a ("LU-17076 nrs: wait for RCU completion")
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I2da668c06b532a41c8ce2fe681ea17cf6f3013ef
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54669
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: James Simmons <jsimmons@infradead.org>
{
if (ldlm_refcount)
CERROR("ldlm_refcount is %d in %s\n", ldlm_refcount, __func__);
- synchronize_rcu();
+ rcu_barrier();
kmem_cache_destroy(ldlm_resource_slab);
/*
* ldlm_lock_put() use RCU to call ldlm_lock_free, so need call
rhashtable_free_and_destroy(&orrd->od_obj_hash,
nrs_orr_hash_exit, NULL);
}
- synchronize_rcu();
+ rcu_barrier();
kmem_cache_destroy(orrd->od_cache);
OBD_FREE_PTR(orrd);