cifs: rcu-delay unload_nls() and freeing sbi
makes ->d_hash(), ->d_compare() and ->permission() safety in RCU mode independent from vfsmount_lock. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
baa40671d3
commit
2e32cf5ef2
2 changed files with 9 additions and 2 deletions
|
@ -65,5 +65,6 @@ struct cifs_sb_info {
|
||||||
char *mountdata; /* options received at mount time or via DFS refs */
|
char *mountdata; /* options received at mount time or via DFS refs */
|
||||||
struct backing_dev_info bdi;
|
struct backing_dev_info bdi;
|
||||||
struct delayed_work prune_tlinks;
|
struct delayed_work prune_tlinks;
|
||||||
|
struct rcu_head rcu;
|
||||||
};
|
};
|
||||||
#endif /* _CIFS_FS_SB_H */
|
#endif /* _CIFS_FS_SB_H */
|
||||||
|
|
|
@ -3755,6 +3755,13 @@ CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void delayed_free(struct rcu_head *p)
|
||||||
|
{
|
||||||
|
struct cifs_sb_info *sbi = container_of(p, struct cifs_sb_info, rcu);
|
||||||
|
unload_nls(sbi->local_nls);
|
||||||
|
kfree(sbi);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cifs_umount(struct cifs_sb_info *cifs_sb)
|
cifs_umount(struct cifs_sb_info *cifs_sb)
|
||||||
{
|
{
|
||||||
|
@ -3779,8 +3786,7 @@ cifs_umount(struct cifs_sb_info *cifs_sb)
|
||||||
|
|
||||||
bdi_destroy(&cifs_sb->bdi);
|
bdi_destroy(&cifs_sb->bdi);
|
||||||
kfree(cifs_sb->mountdata);
|
kfree(cifs_sb->mountdata);
|
||||||
unload_nls(cifs_sb->local_nls);
|
call_rcu(&cifs_sb->rcu, delayed_free);
|
||||||
kfree(cifs_sb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Add table
Reference in a new issue