Skip to content

Commit

Permalink
ext4: Use rcu_barrier() on module unload.
Browse files Browse the repository at this point in the history
The ext4 module uses rcu_call() thus it should use rcu_barrier()on
module unload.

The kmem cache ext4_pspace_cachep is sometimes free'ed using
call_rcu() callbacks.  Thus, we must wait for completion of call_rcu()
before doing kmem_cache_destroy().

Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Jesper Dangaard Brouer authored and Theodore Ts'o committed Jul 6, 2009
1 parent 726447d commit 3e03f9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2909,7 +2909,11 @@ int __init init_ext4_mballoc(void)

void exit_ext4_mballoc(void)
{
/* XXX: synchronize_rcu(); */
/*
* Wait for completion of call_rcu()'s on ext4_pspace_cachep
* before destroying the slab cache.
*/
rcu_barrier();
kmem_cache_destroy(ext4_pspace_cachep);
kmem_cache_destroy(ext4_ac_cachep);
kmem_cache_destroy(ext4_free_ext_cachep);
Expand Down

0 comments on commit 3e03f9c

Please sign in to comment.