From 2fb05c078e88dc542a7d05b319c6162b575887d9 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 26 Aug 2012 20:22:10 -0400 Subject: [PATCH] --- yaml --- r: 328990 b: refs/heads/master c: d6483b7a78438bc333560d11b69e6a6a6cf55940 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/open.c | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 97298fb0fb1a..ebc2103e0a56 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6b48c5b2079af1f81d8f249ae07a988d8c45b32f +refs/heads/master: d6483b7a78438bc333560d11b69e6a6a6cf55940 diff --git a/trunk/fs/open.c b/trunk/fs/open.c index da6d3f1ac243..3c741eae6b99 100644 --- a/trunk/fs/open.c +++ b/trunk/fs/open.c @@ -582,23 +582,21 @@ SYSCALL_DEFINE3(lchown, const char __user *, filename, uid_t, user, gid_t, group SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group) { - struct file * file; - int error = -EBADF; - struct dentry * dentry; + struct file *file; + int error = -EBADF, fput_needed; - file = fget(fd); + file = fget_light(fd, &fput_needed); if (!file) goto out; error = mnt_want_write_file(file); if (error) goto out_fput; - dentry = file->f_path.dentry; - audit_inode(NULL, dentry); + audit_inode(NULL, file->f_path.dentry); error = chown_common(&file->f_path, user, group); mnt_drop_write_file(file); out_fput: - fput(file); + fput_light(file, fput_needed); out: return error; }