[PATCH -V26 15/16] vfs: enable O_PATH descriptor for few syscalls
From: Aneesh Kumar K.V
Date: Sat Jan 29 2011 - 14:09:42 EST
This patch enable O_PATH descriptor for dup*/chmod/chown/stat
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxxxxxxx>
---
fs/fcntl.c | 2 +-
fs/open.c | 4 ++--
fs/stat.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/fcntl.c b/fs/fcntl.c
index ba4b564..b052600 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -131,7 +131,7 @@ SYSCALL_DEFINE2(dup2, unsigned int, oldfd, unsigned int, newfd)
SYSCALL_DEFINE1(dup, unsigned int, fildes)
{
int ret = -EBADF;
- struct file *file = fget(fildes);
+ struct file *file = fget_lenient(fildes);
if (file) {
ret = get_unused_fd();
diff --git a/fs/open.c b/fs/open.c
index 7dbde0f..328a76e 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -447,7 +447,7 @@ SYSCALL_DEFINE2(fchmod, unsigned int, fd, mode_t, mode)
int err = -EBADF;
struct iattr newattrs;
- file = fget(fd);
+ file = fget_lenient(fd);
if (!file)
goto out;
@@ -611,7 +611,7 @@ SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group)
int error = -EBADF;
struct dentry * dentry;
- file = fget(fd);
+ file = fget_lenient(fd);
if (!file)
goto out;
diff --git a/fs/stat.c b/fs/stat.c
index d5c61cf..d88a96a 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -57,7 +57,7 @@ EXPORT_SYMBOL(vfs_getattr);
int vfs_fstat(unsigned int fd, struct kstat *stat)
{
- struct file *f = fget(fd);
+ struct file *f = fget_lenient(fd);
int error = -EBADF;
if (f) {
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/