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>
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index e3ffc5e..f88f752 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -772,13 +772,10 @@
out:
unlock_super(sb);
- d_set_d_op(dentry, sb->s_root->d_op);
dentry->d_time = dentry->d_parent->d_inode->i_version;
dentry = d_splice_alias(inode, dentry);
- if (dentry) {
- d_set_d_op(dentry, sb->s_root->d_op);
+ if (dentry)
dentry->d_time = dentry->d_parent->d_inode->i_version;
- }
return dentry;
error:
@@ -1066,24 +1063,18 @@
.getattr = fat_getattr,
};
+static void setup(struct super_block *sb)
+{
+ if (MSDOS_SB(sb)->options.name_check != 's')
+ sb->s_d_op = &vfat_ci_dentry_ops;
+ else
+ sb->s_d_op = &vfat_dentry_ops;
+}
+
static int vfat_fill_super(struct super_block *sb, void *data, int silent)
{
- int res;
-
- lock_super(sb);
- res = fat_fill_super(sb, data, silent, &vfat_dir_inode_operations, 1);
- if (res) {
- unlock_super(sb);
- return res;
- }
-
- if (MSDOS_SB(sb)->options.name_check != 's')
- d_set_d_op(sb->s_root, &vfat_ci_dentry_ops);
- else
- d_set_d_op(sb->s_root, &vfat_dentry_ops);
-
- unlock_super(sb);
- return 0;
+ return fat_fill_super(sb, data, silent, &vfat_dir_inode_operations,
+ 1, setup);
}
static struct dentry *vfat_mount(struct file_system_type *fs_type,