From: Al Viro Date: Mon, 27 Aug 2012 00:22:10 +0000 (-0400) Subject: switch fchmod(2) to fget_light() X-Git-Tag: upstream/snapshot3+hdmi~6554^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d6483b7a78438bc333560d11b69e6a6a6cf55940;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git switch fchmod(2) to fget_light() Signed-off-by: Al Viro --- diff --git a/fs/open.c b/fs/open.c index da6d3f1..3c741ea 100644 --- a/fs/open.c +++ b/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; }