Skip to content

Commit

Permalink
adfs: delayed freeing of sbi
Browse files Browse the repository at this point in the history
makes ->d_hash() and ->d_compare() safety in RCU mode independent
from vfsmount_lock.

Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Oct 25, 2013
1 parent 30687e0 commit 2d1d9b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions fs/adfs/adfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ struct adfs_dir_ops;
* ADFS file system superblock data in memory
*/
struct adfs_sb_info {
struct adfs_discmap *s_map; /* bh list containing map */
struct adfs_dir_ops *s_dir; /* directory operations */

union { struct {
struct adfs_discmap *s_map; /* bh list containing map */
struct adfs_dir_ops *s_dir; /* directory operations */
};
struct rcu_head rcu; /* used only at shutdown time */
};
kuid_t s_uid; /* owner uid */
kgid_t s_gid; /* owner gid */
umode_t s_owner_mask; /* ADFS owner perm -> unix perm */
Expand Down
3 changes: 1 addition & 2 deletions fs/adfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ static void adfs_put_super(struct super_block *sb)
for (i = 0; i < asb->s_map_size; i++)
brelse(asb->s_map[i].dm_bh);
kfree(asb->s_map);
kfree(asb);
sb->s_fs_info = NULL;
kfree_rcu(asb, rcu);
}

static int adfs_show_options(struct seq_file *seq, struct dentry *root)
Expand Down

0 comments on commit 2d1d9b5

Please sign in to comment.