summaryrefslogtreecommitdiff
path: root/fs/afs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2009-05-08 20:05:57 (GMT)
committerAl Viro <viro@zeniv.linux.org.uk>2009-05-09 14:51:34 (GMT)
commit2a32cebd6cbcc43996c3e2d114fa32ba1e71192a (patch)
tree0ad94849a7bc3e97cd19978005d1898c8bb44b36 /fs/afs
parentf9dbd05bc97d1d4f17c2057612f6a8e4dbd039e0 (diff)
downloadlinux-2a32cebd6cbcc43996c3e2d114fa32ba1e71192a.tar.xz
Fix races around the access to ->s_options
Put generic_show_options read access to s_options under rcu_read_lock, split save_mount_options() into "we are setting it the first time" (uses in foo_fill_super()) and "we are relacing and freeing the old one", synchronize_rcu() before kfree() in the latter. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/super.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/afs/super.c b/fs/afs/super.c
index 2753f16..76828e5 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -408,17 +408,17 @@ static int afs_get_sb(struct file_system_type *fs_type,
deactivate_locked_super(sb);
goto error;
}
- sb->s_options = new_opts;
+ save_mount_options(sb, new_opts);
sb->s_flags |= MS_ACTIVE;
} else {
_debug("reuse");
- kfree(new_opts);
ASSERTCMP(sb->s_flags, &, MS_ACTIVE);
}
simple_set_mnt(mnt, sb);
afs_put_volume(params.volume);
afs_put_cell(params.cell);
+ kfree(new_opts);
_leave(" = 0 [%p]", sb);
return 0;