diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-05-08 22:05:57 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-05-09 16:51:34 +0200 |
commit | 2a32cebd6cbcc43996c3e2d114fa32ba1e71192a (patch) | |
tree | 0ad94849a7bc3e97cd19978005d1898c8bb44b36 /fs/affs | |
parent | switch ufs directories to ufs_sync_file() (diff) | |
download | linux-2a32cebd6cbcc43996c3e2d114fa32ba1e71192a.tar.xz linux-2a32cebd6cbcc43996c3e2d114fa32ba1e71192a.zip |
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/affs')
-rw-r--r-- | fs/affs/super.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c index 5ce695e707fe..63f5183f263b 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -507,8 +507,7 @@ affs_remount(struct super_block *sb, int *flags, char *data) kfree(new_opts); return -EINVAL; } - kfree(sb->s_options); - sb->s_options = new_opts; + replace_mount_options(sb, new_opts); sbi->s_flags = mount_flags; sbi->s_mode = mode; |