Commit c217a2a0 authored by Al Viro's avatar Al Viro

switch utimes() to fget_light/fput_light

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 0aa2ee5f
...@@ -140,18 +140,19 @@ long do_utimes(int dfd, const char __user *filename, struct timespec *times, ...@@ -140,18 +140,19 @@ long do_utimes(int dfd, const char __user *filename, struct timespec *times,
goto out; goto out;
if (filename == NULL && dfd != AT_FDCWD) { if (filename == NULL && dfd != AT_FDCWD) {
int fput_needed;
struct file *file; struct file *file;
if (flags & AT_SYMLINK_NOFOLLOW) if (flags & AT_SYMLINK_NOFOLLOW)
goto out; goto out;
file = fget(dfd); file = fget_light(dfd, &fput_needed);
error = -EBADF; error = -EBADF;
if (!file) if (!file)
goto out; goto out;
error = utimes_common(&file->f_path, times); error = utimes_common(&file->f_path, times);
fput(file); fput_light(file, fput_needed);
} else { } else {
struct path path; struct path path;
int lookup_flags = 0; int lookup_flags = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment