aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/super.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2007-04-26 18:56:24 -0400
committerDavid S. Miller <davem@davemloft.net>2007-04-26 18:56:24 -0400
commit436058a49e0fb91c74454dbee9cfee6fb53b4336 (patch)
treec10043dd582cf9697c0a042427f48af6d2e87e0c /fs/afs/super.c
parent63b6be55e8b51cb718468794d343058e96c7462c (diff)
[AFS]: Handle multiple mounts of an AFS superblock correctly.
Handle multiple mounts of an AFS superblock correctly, checking to see whether the superblock is already initialised after calling sget() rather than just unconditionally stamping all over it. Also delete the "silent" parameter to afs_fill_super() as it's not used and can, in any case, be obtained from sb->s_flags. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/afs/super.c')
-rw-r--r--fs/afs/super.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/fs/afs/super.c b/fs/afs/super.c
index efc4fe69f4f0..77e68759788f 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -212,7 +212,7 @@ static int afs_test_super(struct super_block *sb, void *data)
212/* 212/*
213 * fill in the superblock 213 * fill in the superblock
214 */ 214 */
215static int afs_fill_super(struct super_block *sb, void *data, int silent) 215static int afs_fill_super(struct super_block *sb, void *data)
216{ 216{
217 struct afs_mount_params *params = data; 217 struct afs_mount_params *params = data;
218 struct afs_super_info *as = NULL; 218 struct afs_super_info *as = NULL;
@@ -319,17 +319,23 @@ static int afs_get_sb(struct file_system_type *fs_type,
319 goto error; 319 goto error;
320 } 320 }
321 321
322 sb->s_flags = flags; 322 if (!sb->s_root) {
323 323 /* initial superblock/root creation */
324 ret = afs_fill_super(sb, &params, flags & MS_SILENT ? 1 : 0); 324 _debug("create");
325 if (ret < 0) { 325 sb->s_flags = flags;
326 up_write(&sb->s_umount); 326 ret = afs_fill_super(sb, &params);
327 deactivate_super(sb); 327 if (ret < 0) {
328 goto error; 328 up_write(&sb->s_umount);
329 deactivate_super(sb);
330 goto error;
331 }
332 sb->s_flags |= MS_ACTIVE;
333 } else {
334 _debug("reuse");
335 ASSERTCMP(sb->s_flags, &, MS_ACTIVE);
329 } 336 }
330 sb->s_flags |= MS_ACTIVE;
331 simple_set_mnt(mnt, sb);
332 337
338 simple_set_mnt(mnt, sb);
333 afs_put_volume(params.volume); 339 afs_put_volume(params.volume);
334 afs_put_cell(params.default_cell); 340 afs_put_cell(params.default_cell);
335 _leave(" = 0 [%p]", sb); 341 _leave(" = 0 [%p]", sb);