aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/utimes.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/utimes.c b/fs/utimes.c
index 118d1c3241be..b6b664e7145e 100644
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -148,14 +148,9 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
148 goto mnt_drop_write_and_out; 148 goto mnt_drop_write_and_out;
149 149
150 if (!is_owner_or_cap(inode)) { 150 if (!is_owner_or_cap(inode)) {
151 if (f) { 151 error = permission(inode, MAY_WRITE, NULL);
152 if (!(f->f_mode & FMODE_WRITE)) 152 if (error)
153 goto mnt_drop_write_and_out; 153 goto mnt_drop_write_and_out;
154 } else {
155 error = vfs_permission(&nd, MAY_WRITE);
156 if (error)
157 goto mnt_drop_write_and_out;
158 }
159 } 154 }
160 } 155 }
161 mutex_lock(&inode->i_mutex); 156 mutex_lock(&inode->i_mutex);