aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorJan Blunck <jblunck@infradead.org>2010-08-15 16:51:10 -0400
committerArnd Bergmann <arnd@arndb.de>2010-10-04 15:10:10 -0400
commitdb71922217a214e5c9268448e537b54fc1f301ea (patch)
tree9c9afbf29411547891f6968e5ade29ce59d66c07 /fs/jffs2
parent899611ee7d373e5eeda08e9a8632684e1ebbbf00 (diff)
BKL: Explicitly add BKL around get_sb/fill_super
This patch is a preparation necessary to remove the BKL from do_new_mount(). It explicitly adds calls to lock_kernel()/unlock_kernel() around get_sb/fill_super operations for filesystems that still uses the BKL. I've read through all the code formerly covered by the BKL inside do_kern_mount() and have satisfied myself that it doesn't need the BKL any more. do_kern_mount() is already called without the BKL when mounting the rootfs and in nfsctl. do_kern_mount() calls vfs_kern_mount(), which is called from various places without BKL: simple_pin_fs(), nfs_do_clone_mount() through nfs_follow_mountpoint(), afs_mntpt_do_automount() through afs_mntpt_follow_link(). Both later functions are actually the filesystems follow_link inode operation. vfs_kern_mount() is calling the specified get_sb function and lets the filesystem do its job by calling the given fill_super function. Therefore I think it is safe to push down the BKL from the VFS to the low-level filesystems get_sb/fill_super operation. [arnd: do not add the BKL to those file systems that already don't use it elsewhere] Signed-off-by: Jan Blunck <jblunck@infradead.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Matthew Wilcox <matthew@wil.cx> Cc: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/super.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 662bba099501..58dd9cf06206 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -146,14 +146,19 @@ static const struct super_operations jffs2_super_operations =
146static int jffs2_fill_super(struct super_block *sb, void *data, int silent) 146static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
147{ 147{
148 struct jffs2_sb_info *c; 148 struct jffs2_sb_info *c;
149 int ret;
150
151 lock_kernel();
149 152
150 D1(printk(KERN_DEBUG "jffs2_get_sb_mtd():" 153 D1(printk(KERN_DEBUG "jffs2_get_sb_mtd():"
151 " New superblock for device %d (\"%s\")\n", 154 " New superblock for device %d (\"%s\")\n",
152 sb->s_mtd->index, sb->s_mtd->name)); 155 sb->s_mtd->index, sb->s_mtd->name));
153 156
154 c = kzalloc(sizeof(*c), GFP_KERNEL); 157 c = kzalloc(sizeof(*c), GFP_KERNEL);
155 if (!c) 158 if (!c) {
159 unlock_kernel();
156 return -ENOMEM; 160 return -ENOMEM;
161 }
157 162
158 c->mtd = sb->s_mtd; 163 c->mtd = sb->s_mtd;
159 c->os_priv = sb; 164 c->os_priv = sb;
@@ -175,7 +180,9 @@ static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
175#ifdef CONFIG_JFFS2_FS_POSIX_ACL 180#ifdef CONFIG_JFFS2_FS_POSIX_ACL
176 sb->s_flags |= MS_POSIXACL; 181 sb->s_flags |= MS_POSIXACL;
177#endif 182#endif
178 return jffs2_do_fill_super(sb, data, silent); 183 ret = jffs2_do_fill_super(sb, data, silent);
184 unlock_kernel();
185 return ret;
179} 186}
180 187
181static int jffs2_get_sb(struct file_system_type *fs_type, 188static int jffs2_get_sb(struct file_system_type *fs_type,