[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>
This commit is contained in:
David Howells 2007-04-26 15:56:24 -07:00 committed by David S. Miller
parent 63b6be55e8
commit 436058a49e
1 changed files with 16 additions and 10 deletions

View File

@ -212,7 +212,7 @@ static int afs_test_super(struct super_block *sb, void *data)
/* /*
* fill in the superblock * fill in the superblock
*/ */
static int afs_fill_super(struct super_block *sb, void *data, int silent) static int afs_fill_super(struct super_block *sb, void *data)
{ {
struct afs_mount_params *params = data; struct afs_mount_params *params = data;
struct afs_super_info *as = NULL; struct afs_super_info *as = NULL;
@ -319,17 +319,23 @@ static int afs_get_sb(struct file_system_type *fs_type,
goto error; goto error;
} }
sb->s_flags = flags; if (!sb->s_root) {
/* initial superblock/root creation */
ret = afs_fill_super(sb, &params, flags & MS_SILENT ? 1 : 0); _debug("create");
if (ret < 0) { sb->s_flags = flags;
up_write(&sb->s_umount); ret = afs_fill_super(sb, &params);
deactivate_super(sb); if (ret < 0) {
goto error; up_write(&sb->s_umount);
deactivate_super(sb);
goto error;
}
sb->s_flags |= MS_ACTIVE;
} else {
_debug("reuse");
ASSERTCMP(sb->s_flags, &, MS_ACTIVE);
} }
sb->s_flags |= MS_ACTIVE;
simple_set_mnt(mnt, sb);
simple_set_mnt(mnt, sb);
afs_put_volume(params.volume); afs_put_volume(params.volume);
afs_put_cell(params.default_cell); afs_put_cell(params.default_cell);
_leave(" = 0 [%p]", sb); _leave(" = 0 [%p]", sb);