summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/utimes.c13
-rw-r--r--mm/filemap.c1
2 files changed, 10 insertions, 4 deletions
diff --git a/fs/utimes.c b/fs/utimes.c
index 480f7c8c29da..b3c88952465f 100644
--- a/fs/utimes.c
+++ b/fs/utimes.c
@@ -106,9 +106,16 @@ long do_utimes(int dfd, char __user *filename, struct timespec *times, int flags
if (IS_IMMUTABLE(inode))
goto dput_and_out;
- if (current->fsuid != inode->i_uid &&
- (error = vfs_permission(&nd, MAY_WRITE)) != 0)
- goto dput_and_out;
+ if (current->fsuid != inode->i_uid) {
+ if (f) {
+ if (!(f->f_mode & FMODE_WRITE))
+ goto dput_and_out;
+ } else {
+ error = vfs_permission(&nd, MAY_WRITE);
+ if (error)
+ goto dput_and_out;
+ }
+ }
}
mutex_lock(&inode->i_mutex);
error = notify_change(dentry, &newattrs);
diff --git a/mm/filemap.c b/mm/filemap.c
index edb1b0b5cc8d..d1d9814f99dd 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1786,7 +1786,6 @@ retry:
page = __read_cache_page(mapping, index, filler, data);
if (IS_ERR(page))
return page;
- mark_page_accessed(page);
if (PageUptodate(page))
goto out;