aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/namei_msdos.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-12-18 10:44:00 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2011-01-12 20:02:43 -0500
commit3d23985d6cfa7908e46fd0c62a2ee84faffe4d8b (patch)
tree5561a4f3eb3ef265de2b6d224194ff58b713fe0a /fs/fat/namei_msdos.c
parent6cc9c1d2c1414ef67f465462aa96a5d1fed12f5d (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_msdos.c')
-rw-r--r--fs/fat/namei_msdos.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c
index 35ffe43afa4b..711499040eb6 100644
--- a/fs/fat/namei_msdos.c
+++ b/fs/fat/namei_msdos.c
@@ -227,11 +227,7 @@ static struct dentry *msdos_lookup(struct inode *dir, struct dentry *dentry,
227 } 227 }
228out: 228out:
229 unlock_super(sb); 229 unlock_super(sb);
230 d_set_d_op(dentry, &msdos_dentry_operations); 230 return d_splice_alias(inode, dentry);
231 dentry = d_splice_alias(inode, dentry);
232 if (dentry)
233 d_set_d_op(dentry, &msdos_dentry_operations);
234 return dentry;
235 231
236error: 232error:
237 unlock_super(sb); 233 unlock_super(sb);
@@ -661,21 +657,16 @@ static const struct inode_operations msdos_dir_inode_operations = {
661 .getattr = fat_getattr, 657 .getattr = fat_getattr,
662}; 658};
663 659
664static int msdos_fill_super(struct super_block *sb, void *data, int silent) 660static void setup(struct super_block *sb)
665{ 661{
666 int res; 662 sb->s_d_op = &msdos_dentry_operations;
667
668 lock_super(sb);
669 res = fat_fill_super(sb, data, silent, &msdos_dir_inode_operations, 0);
670 if (res) {
671 unlock_super(sb);
672 return res;
673 }
674
675 sb->s_flags |= MS_NOATIME; 663 sb->s_flags |= MS_NOATIME;
676 d_set_d_op(sb->s_root, &msdos_dentry_operations); 664}
677 unlock_super(sb); 665
678 return 0; 666static int msdos_fill_super(struct super_block *sb, void *data, int silent)
667{
668 return fat_fill_super(sb, data, silent, &msdos_dir_inode_operations,
669 0, setup);
679} 670}
680 671
681static struct dentry *msdos_mount(struct file_system_type *fs_type, 672static struct dentry *msdos_mount(struct file_system_type *fs_type,