diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2009-05-20 09:02:28 +0200 | 
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2009-05-20 09:02:28 +0200 | 
| commit | 521c180874dae86f675d23c4eade4dba8b1f2cc8 (patch) | |
| tree | 7509303da3a9a1b40a26f6811f321c89cd31737b /fs/namespace.c | |
| parent | f1a11e0576c7a73d759d05d776692b2b2d37172b (diff) | |
| parent | 64d1304a64477629cb16b75491a77bafe6f86963 (diff) | |
Merge branch 'core/urgent' into core/futexes
Merge reason: this branch was on an pre -rc1 base, merge it up to -rc6+
              to get the latest upstream fixes.
Conflicts:
	kernel/futex.c
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/namespace.c')
| -rw-r--r-- | fs/namespace.c | 30 | 
1 files changed, 22 insertions, 8 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index c6f54e4c429..134d494158d 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -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;  } @@ -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) @@ -1073,9 +1088,7 @@ static int do_umount(struct vfsmount *mnt, int flags)  	 */  	if (flags & MNT_FORCE && sb->s_op->umount_begin) { -		lock_kernel();  		sb->s_op->umount_begin(sb); -		unlock_kernel();  	}  	/* @@ -1377,7 +1390,7 @@ static int attach_recursive_mnt(struct vfsmount *source_mnt,  	if (parent_path) {  		detach_mnt(source_mnt, parent_path);  		attach_mnt(source_mnt, path); -		touch_mnt_namespace(current->nsproxy->mnt_ns); +		touch_mnt_namespace(parent_path->mnt->mnt_ns);  	} else {  		mnt_set_mountpoint(dest_mnt, dest_dentry, source_mnt);  		commit_tree(source_mnt); @@ -1920,8 +1933,9 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,  	if (data_page)  		((char *)data_page)[PAGE_SIZE - 1] = 0; -	/* Default to relatime */ -	mnt_flags |= MNT_RELATIME; +	/* Default to relatime unless overriden */ +	if (!(flags & MS_NOATIME)) +		mnt_flags |= MNT_RELATIME;  	/* Separate the per-mountpoint flags */  	if (flags & MS_NOSUID)  | 
