aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs
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/afs
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/afs')
-rw-r--r--fs/afs/super.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/afs/super.c b/fs/afs/super.c
index 77e1e5a61154..6c2fef44d385 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -302,12 +302,15 @@ static int afs_fill_super(struct super_block *sb, void *data)
302 struct inode *inode = NULL; 302 struct inode *inode = NULL;
303 int ret; 303 int ret;
304 304
305 lock_kernel();
306
305 _enter(""); 307 _enter("");
306 308
307 /* allocate a superblock info record */ 309 /* allocate a superblock info record */
308 as = kzalloc(sizeof(struct afs_super_info), GFP_KERNEL); 310 as = kzalloc(sizeof(struct afs_super_info), GFP_KERNEL);
309 if (!as) { 311 if (!as) {
310 _leave(" = -ENOMEM"); 312 _leave(" = -ENOMEM");
313 unlock_kernel();
311 return -ENOMEM; 314 return -ENOMEM;
312 } 315 }
313 316
@@ -341,6 +344,7 @@ static int afs_fill_super(struct super_block *sb, void *data)
341 sb->s_root = root; 344 sb->s_root = root;
342 345
343 _leave(" = 0"); 346 _leave(" = 0");
347 unlock_kernel();
344 return 0; 348 return 0;
345 349
346error_inode: 350error_inode:
@@ -354,6 +358,7 @@ error:
354 sb->s_fs_info = NULL; 358 sb->s_fs_info = NULL;
355 359
356 _leave(" = %d", ret); 360 _leave(" = %d", ret);
361 unlock_kernel();
357 return ret; 362 return ret;
358} 363}
359 364