Skip to content

Commit

Permalink
ext4: destroy ext4_fc_dentry_cachep kmemcache on module removal
Browse files Browse the repository at this point in the history
The kmemcache for ext4_fc_dentry_cachep remains registered after module
removal.

Destroy ext4_fc_dentry_cachep kmemcache on module removal.

Fixes: aa75f4d ("ext4: main fast-commit commit path")
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Reviewed-by: Lukas Czerner <[email protected]>
Reviewed-by: Harshad Shirwadkar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
Cc: [email protected]
  • Loading branch information
Sebastian Andrzej Siewior authored and tytso committed Jan 10, 2022
1 parent 9725958 commit ab047d5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions fs/ext4/ext4.h
Original file line number Diff line number Diff line change
Expand Up @@ -2932,6 +2932,7 @@ bool ext4_fc_replay_check_excluded(struct super_block *sb, ext4_fsblk_t block);
void ext4_fc_replay_cleanup(struct super_block *sb);
int ext4_fc_commit(journal_t *journal, tid_t commit_tid);
int __init ext4_fc_init_dentry_cache(void);
void ext4_fc_destroy_dentry_cache(void);

/* mballoc.c */
extern const struct seq_operations ext4_mb_seq_groups_ops;
Expand Down
5 changes: 5 additions & 0 deletions fs/ext4/fast_commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -2153,3 +2153,8 @@ int __init ext4_fc_init_dentry_cache(void)

return 0;
}

void ext4_fc_destroy_dentry_cache(void)
{
kmem_cache_destroy(ext4_fc_dentry_cachep);
}
2 changes: 2 additions & 0 deletions fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -7118,6 +7118,7 @@ static int __init ext4_init_fs(void)
out:
unregister_as_ext2();
unregister_as_ext3();
ext4_fc_destroy_dentry_cache();
out05:
destroy_inodecache();
out1:
Expand All @@ -7144,6 +7145,7 @@ static void __exit ext4_exit_fs(void)
unregister_as_ext2();
unregister_as_ext3();
unregister_filesystem(&ext4_fs_type);
ext4_fc_destroy_dentry_cache();
destroy_inodecache();
ext4_exit_mballoc();
ext4_exit_sysfs();
Expand Down

0 comments on commit ab047d5

Please sign in to comment.