diff options
author | Dave Hansen <haveblue@us.ibm.com> | 2008-02-15 17:37:49 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-04-19 00:25:34 -0400 |
commit | 9079b1eb1753f217c3de9f1b7dd7fd549cc3f0cf (patch) | |
tree | 8e522ad0b16829849e4b1602270eb10997fba41d /fs/namei.c | |
parent | 75c3f29de7451677c59580b0a959f694f36aac28 (diff) |
[PATCH] r/o bind mounts: get write access for vfs_rename() callers
This also uses the little helper in the NFS code to make an if() a little bit
less ugly. We introduced the helper at the beginning of the series.
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c index 00df735fb509..83c843b3fea3 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2718,8 +2718,12 @@ static int do_rename(int olddfd, const char *oldname, | |||
2718 | if (new_dentry == trap) | 2718 | if (new_dentry == trap) |
2719 | goto exit5; | 2719 | goto exit5; |
2720 | 2720 | ||
2721 | error = mnt_want_write(oldnd.path.mnt); | ||
2722 | if (error) | ||
2723 | goto exit5; | ||
2721 | error = vfs_rename(old_dir->d_inode, old_dentry, | 2724 | error = vfs_rename(old_dir->d_inode, old_dentry, |
2722 | new_dir->d_inode, new_dentry); | 2725 | new_dir->d_inode, new_dentry); |
2726 | mnt_drop_write(oldnd.path.mnt); | ||
2723 | exit5: | 2727 | exit5: |
2724 | dput(new_dentry); | 2728 | dput(new_dentry); |
2725 | exit4: | 2729 | exit4: |