diff options
author | 2023-09-19 20:18:59 -0400 | |
---|---|---|
committer | 2024-02-25 02:10:31 -0500 | |
commit | af072cf683acd2307e02378cfcf2502c49d2e127 (patch) | |
tree | 790a21d7610d3ead80be4ad0b21936f92d9f247d /fs/hfsplus/super.c | |
parent | exfat: move freeing sbi, upcase table and dropping nls into rcu-delayed helper (diff) | |
download | linux-rng-af072cf683acd2307e02378cfcf2502c49d2e127.tar.xz linux-rng-af072cf683acd2307e02378cfcf2502c49d2e127.zip |
hfsplus: switch to rcu-delayed unloading of nls and freeing ->s_fs_info
->d_hash() and ->d_compare() use those, so we need to delay freeing
them.
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
-rw-r--r-- | fs/hfsplus/super.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 1986b4f18a90..97920202790f 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -277,6 +277,14 @@ void hfsplus_mark_mdb_dirty(struct super_block *sb) spin_unlock(&sbi->work_lock); } +static void delayed_free(struct rcu_head *p) +{ + struct hfsplus_sb_info *sbi = container_of(p, struct hfsplus_sb_info, rcu); + + unload_nls(sbi->nls); + kfree(sbi); +} + static void hfsplus_put_super(struct super_block *sb) { struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb); @@ -302,9 +310,7 @@ static void hfsplus_put_super(struct super_block *sb) hfs_btree_close(sbi->ext_tree); kfree(sbi->s_vhdr_buf); kfree(sbi->s_backup_vhdr_buf); - unload_nls(sbi->nls); - kfree(sb->s_fs_info); - sb->s_fs_info = NULL; + call_rcu(&sbi->rcu, delayed_free); } static int hfsplus_statfs(struct dentry *dentry, struct kstatfs *buf) |