aboutsummaryrefslogtreecommitdiffstats
path: root/fs/utimes.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-04-21 18:47:57 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-29 23:28:32 -0400
commitc217a2a004d98d09dfceec3a023c563ed800e833 (patch)
tree3e6b3060da67050274bee8155de5d615f5c11aa6 /fs/utimes.c
parent0aa2ee5f0a341a7fc081a499b221d29784ed711d (diff)
switch utimes() to fget_light/fput_light
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/utimes.c')
-rw-r--r--fs/utimes.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/utimes.c b/fs/utimes.c
index ba653f3dc1bc..fa4dbe451e27 100644
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -140,18 +140,19 @@ long do_utimes(int dfd, const char __user *filename, struct timespec *times,
140 goto out; 140 goto out;
141 141
142 if (filename == NULL && dfd != AT_FDCWD) { 142 if (filename == NULL && dfd != AT_FDCWD) {
143 int fput_needed;
143 struct file *file; 144 struct file *file;
144 145
145 if (flags & AT_SYMLINK_NOFOLLOW) 146 if (flags & AT_SYMLINK_NOFOLLOW)
146 goto out; 147 goto out;
147 148
148 file = fget(dfd); 149 file = fget_light(dfd, &fput_needed);
149 error = -EBADF; 150 error = -EBADF;
150 if (!file) 151 if (!file)
151 goto out; 152 goto out;
152 153
153 error = utimes_common(&file->f_path, times); 154 error = utimes_common(&file->f_path, times);
154 fput(file); 155 fput_light(file, fput_needed);
155 } else { 156 } else {
156 struct path path; 157 struct path path;
157 int lookup_flags = 0; 158 int lookup_flags = 0;