Fix races around the access to ->s_options
[linux-2.6-block.git] / fs / afs / super.c
index 2753f16dd31558a0b34c04218c33bf75759eb9bf..76828e5f8a3901b27d0d47f2b6af143cdacc00b1 100644 (file)
@@ -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;