Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144821
b: refs/heads/master
c: 2a32ceb
h: refs/heads/master
i:
  144819: 94486fb
v: v3
  • Loading branch information
Al Viro committed May 9, 2009
1 parent d184d8b commit cf32958
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f9dbd05bc97d1d4f17c2057612f6a8e4dbd039e0
refs/heads/master: 2a32cebd6cbcc43996c3e2d114fa32ba1e71192a
3 changes: 1 addition & 2 deletions trunk/drivers/isdn/capi/capifs.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ static int capifs_remount(struct super_block *s, int *flags, char *data)
}
}

kfree(s->s_options);
s->s_options = new_opt;
replace_mount_options(s, new_opt);

config.setuid = setuid;
config.setgid = setgid;
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/affs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/afs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/hpfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)

if (!(*flags & MS_RDONLY)) mark_dirty(s);

kfree(s->s_options);
s->s_options = new_opts;
replace_mount_options(s, new_opts);

return 0;

Expand Down
21 changes: 18 additions & 3 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,12 +695,16 @@ static inline void mangle(struct seq_file *m, const char *s)
*/
int generic_show_options(struct seq_file *m, struct vfsmount *mnt)
{
const char *options = mnt->mnt_sb->s_options;
const char *options;

rcu_read_lock();
options = rcu_dereference(mnt->mnt_sb->s_options);

if (options != NULL && options[0]) {
seq_putc(m, ',');
mangle(m, options);
}
rcu_read_unlock();

return 0;
}
Expand All @@ -721,11 +725,22 @@ EXPORT_SYMBOL(generic_show_options);
*/
void save_mount_options(struct super_block *sb, char *options)
{
kfree(sb->s_options);
sb->s_options = kstrdup(options, GFP_KERNEL);
BUG_ON(sb->s_options);
rcu_assign_pointer(sb->s_options, kstrdup(options, GFP_KERNEL));
}
EXPORT_SYMBOL(save_mount_options);

void replace_mount_options(struct super_block *sb, char *options)
{
char *old = sb->s_options;
rcu_assign_pointer(sb->s_options, options);
if (old) {
synchronize_rcu();
kfree(old);
}
}
EXPORT_SYMBOL(replace_mount_options);

#ifdef CONFIG_PROC_FS
/* iterator */
static void *m_start(struct seq_file *m, loff_t *pos)
Expand Down
3 changes: 1 addition & 2 deletions trunk/fs/reiserfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1316,8 +1316,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg)
}

out_ok:
kfree(s->s_options);
s->s_options = new_opts;
replace_mount_options(s, new_opts);
return 0;

out_err:
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2368,6 +2368,7 @@ extern void file_update_time(struct file *file);

extern int generic_show_options(struct seq_file *m, struct vfsmount *mnt);
extern void save_mount_options(struct super_block *sb, char *options);
extern void replace_mount_options(struct super_block *sb, char *options);

static inline ino_t parent_ino(struct dentry *dentry)
{
Expand Down

0 comments on commit cf32958

Please sign in to comment.