lkml.org 
[lkml]   [2011]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH -V26 15/16] vfs: enable O_PATH descriptor for few syscalls
    Date
    This patch enable O_PATH descriptor for dup*/chmod/chown/stat

    Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    ---
    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


    \
     
     \ /
      Last update: 2011-01-29 20:13    [W:0.025 / U:32.652 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site