diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-12-18 10:44:00 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-12 20:02:43 -0500 |
commit | 3d23985d6cfa7908e46fd0c62a2ee84faffe4d8b (patch) | |
tree | 5561a4f3eb3ef265de2b6d224194ff58b713fe0a /fs/fat/namei_vfat.c | |
parent | 6cc9c1d2c1414ef67f465462aa96a5d1fed12f5d (diff) |
switch fat to ->s_d_op, close exportfs races there
don't bother with lock_super() in fat_fill_super() callers, while
we are at it - there won't be any concurrency anyway.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fat/namei_vfat.c')
-rw-r--r-- | fs/fat/namei_vfat.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c index e3ffc5e12332..f88f752babd9 100644 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c | |||
@@ -772,13 +772,10 @@ static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry, | |||
772 | 772 | ||
773 | out: | 773 | out: |
774 | unlock_super(sb); | 774 | unlock_super(sb); |
775 | d_set_d_op(dentry, sb->s_root->d_op); | ||
776 | dentry->d_time = dentry->d_parent->d_inode->i_version; | 775 | dentry->d_time = dentry->d_parent->d_inode->i_version; |
777 | dentry = d_splice_alias(inode, dentry); | 776 | dentry = d_splice_alias(inode, dentry); |
778 | if (dentry) { | 777 | if (dentry) |
779 | d_set_d_op(dentry, sb->s_root->d_op); | ||
780 | dentry->d_time = dentry->d_parent->d_inode->i_version; | 778 | dentry->d_time = dentry->d_parent->d_inode->i_version; |
781 | } | ||
782 | return dentry; | 779 | return dentry; |
783 | 780 | ||
784 | error: | 781 | error: |
@@ -1066,24 +1063,18 @@ static const struct inode_operations vfat_dir_inode_operations = { | |||
1066 | .getattr = fat_getattr, | 1063 | .getattr = fat_getattr, |
1067 | }; | 1064 | }; |
1068 | 1065 | ||
1069 | static int vfat_fill_super(struct super_block *sb, void *data, int silent) | 1066 | static void setup(struct super_block *sb) |
1070 | { | 1067 | { |
1071 | int res; | ||
1072 | |||
1073 | lock_super(sb); | ||
1074 | res = fat_fill_super(sb, data, silent, &vfat_dir_inode_operations, 1); | ||
1075 | if (res) { | ||
1076 | unlock_super(sb); | ||
1077 | return res; | ||
1078 | } | ||
1079 | |||
1080 | if (MSDOS_SB(sb)->options.name_check != 's') | 1068 | if (MSDOS_SB(sb)->options.name_check != 's') |
1081 | d_set_d_op(sb->s_root, &vfat_ci_dentry_ops); | 1069 | sb->s_d_op = &vfat_ci_dentry_ops; |
1082 | else | 1070 | else |
1083 | d_set_d_op(sb->s_root, &vfat_dentry_ops); | 1071 | sb->s_d_op = &vfat_dentry_ops; |
1072 | } | ||
1084 | 1073 | ||
1085 | unlock_super(sb); | 1074 | static int vfat_fill_super(struct super_block *sb, void *data, int silent) |
1086 | return 0; | 1075 | { |
1076 | return fat_fill_super(sb, data, silent, &vfat_dir_inode_operations, | ||
1077 | 1, setup); | ||
1087 | } | 1078 | } |
1088 | 1079 | ||
1089 | static struct dentry *vfat_mount(struct file_system_type *fs_type, | 1080 | static struct dentry *vfat_mount(struct file_system_type *fs_type, |