aboutsummaryrefslogtreecommitdiffstats
path: root/fs/coda
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/coda
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/coda')
-rw-r--r--fs/coda/inode.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index 6526e6f21ecf..bfe8179b1295 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -148,6 +148,8 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
148 int error; 148 int error;
149 int idx; 149 int idx;
150 150
151 lock_kernel();
152
151 idx = get_device_index((struct coda_mount_data *) data); 153 idx = get_device_index((struct coda_mount_data *) data);
152 154
153 /* Ignore errors in data, for backward compatibility */ 155 /* Ignore errors in data, for backward compatibility */
@@ -159,11 +161,13 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
159 vc = &coda_comms[idx]; 161 vc = &coda_comms[idx];
160 if (!vc->vc_inuse) { 162 if (!vc->vc_inuse) {
161 printk("coda_read_super: No pseudo device\n"); 163 printk("coda_read_super: No pseudo device\n");
164 unlock_kernel();
162 return -EINVAL; 165 return -EINVAL;
163 } 166 }
164 167
165 if ( vc->vc_sb ) { 168 if ( vc->vc_sb ) {
166 printk("coda_read_super: Device already mounted\n"); 169 printk("coda_read_super: Device already mounted\n");
170 unlock_kernel();
167 return -EBUSY; 171 return -EBUSY;
168 } 172 }
169 173
@@ -202,7 +206,8 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
202 sb->s_root = d_alloc_root(root); 206 sb->s_root = d_alloc_root(root);
203 if (!sb->s_root) 207 if (!sb->s_root)
204 goto error; 208 goto error;
205 return 0; 209 unlock_kernel();
210 return 0;
206 211
207 error: 212 error:
208 bdi_destroy(&vc->bdi); 213 bdi_destroy(&vc->bdi);
@@ -212,6 +217,7 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
212 if (vc) 217 if (vc)
213 vc->vc_sb = NULL; 218 vc->vc_sb = NULL;
214 219
220 unlock_kernel();
215 return -EINVAL; 221 return -EINVAL;
216} 222}
217 223