Commit c217a2a004d98d09dfceec3a023c563ed800e833
1 parent
0aa2ee5f0a
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
switch utimes() to fget_light/fput_light
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff
fs/utimes.c
... | ... | @@ -140,18 +140,19 @@ |
140 | 140 | goto out; |
141 | 141 | |
142 | 142 | if (filename == NULL && dfd != AT_FDCWD) { |
143 | + int fput_needed; | |
143 | 144 | struct file *file; |
144 | 145 | |
145 | 146 | if (flags & AT_SYMLINK_NOFOLLOW) |
146 | 147 | goto out; |
147 | 148 | |
148 | - file = fget(dfd); | |
149 | + file = fget_light(dfd, &fput_needed); | |
149 | 150 | error = -EBADF; |
150 | 151 | if (!file) |
151 | 152 | goto out; |
152 | 153 | |
153 | 154 | error = utimes_common(&file->f_path, times); |
154 | - fput(file); | |
155 | + fput_light(file, fput_needed); | |
155 | 156 | } else { |
156 | 157 | struct path path; |
157 | 158 | int lookup_flags = 0; |