diff options
author | Dave Hansen <haveblue@us.ibm.com> | 2008-02-15 17:37:45 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2008-04-19 00:25:34 -0400 |
commit | 75c3f29de7451677c59580b0a959f694f36aac28 (patch) | |
tree | c82ad50102bfa38f2dc6bb0f763cde9f3dff3790 /fs/namei.c | |
parent | 463c3197263bd26ac59a00d2484990e17e35c50e (diff) |
[PATCH] r/o bind mounts: write counts for link/symlink
[AV: add missing nfsd pieces]
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: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c index 3fbcf2021a2e..00df735fb509 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2387,7 +2387,12 @@ asmlinkage long sys_symlinkat(const char __user *oldname, | |||
2387 | if (IS_ERR(dentry)) | 2387 | if (IS_ERR(dentry)) |
2388 | goto out_unlock; | 2388 | goto out_unlock; |
2389 | 2389 | ||
2390 | error = mnt_want_write(nd.path.mnt); | ||
2391 | if (error) | ||
2392 | goto out_dput; | ||
2390 | error = vfs_symlink(nd.path.dentry->d_inode, dentry, from, S_IALLUGO); | 2393 | error = vfs_symlink(nd.path.dentry->d_inode, dentry, from, S_IALLUGO); |
2394 | mnt_drop_write(nd.path.mnt); | ||
2395 | out_dput: | ||
2391 | dput(dentry); | 2396 | dput(dentry); |
2392 | out_unlock: | 2397 | out_unlock: |
2393 | mutex_unlock(&nd.path.dentry->d_inode->i_mutex); | 2398 | mutex_unlock(&nd.path.dentry->d_inode->i_mutex); |
@@ -2482,7 +2487,12 @@ asmlinkage long sys_linkat(int olddfd, const char __user *oldname, | |||
2482 | error = PTR_ERR(new_dentry); | 2487 | error = PTR_ERR(new_dentry); |
2483 | if (IS_ERR(new_dentry)) | 2488 | if (IS_ERR(new_dentry)) |
2484 | goto out_unlock; | 2489 | goto out_unlock; |
2490 | error = mnt_want_write(nd.path.mnt); | ||
2491 | if (error) | ||
2492 | goto out_dput; | ||
2485 | error = vfs_link(old_nd.path.dentry, nd.path.dentry->d_inode, new_dentry); | 2493 | error = vfs_link(old_nd.path.dentry, nd.path.dentry->d_inode, new_dentry); |
2494 | mnt_drop_write(nd.path.mnt); | ||
2495 | out_dput: | ||
2486 | dput(new_dentry); | 2496 | dput(new_dentry); |
2487 | out_unlock: | 2497 | out_unlock: |
2488 | mutex_unlock(&nd.path.dentry->d_inode->i_mutex); | 2498 | mutex_unlock(&nd.path.dentry->d_inode->i_mutex); |