aboutsummaryrefslogtreecommitdiffstats
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
106 if (IS_IMMUTABLE(inode)) 106 if (IS_IMMUTABLE(inode))
107 goto dput_and_out; 107 goto dput_and_out;
108 108
109 if (current->fsuid != inode->i_uid && 109 if (current->fsuid != inode->i_uid) {
110 (error = vfs_permission(&nd, MAY_WRITE)) != 0) 110 if (f) {
111 goto dput_and_out; 111 if (!(f->f_mode & FMODE_WRITE))
112 goto dput_and_out;
113 } else {
114 error = vfs_permission(&nd, MAY_WRITE);
115 if (error)
116 goto dput_and_out;
117 }
118 }
112 } 119 }
113 mutex_lock(&inode->i_mutex); 120 mutex_lock(&inode->i_mutex);
114 error = notify_change(dentry, &newattrs); 121 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:
1786 page = __read_cache_page(mapping, index, filler, data); 1786 page = __read_cache_page(mapping, index, filler, data);
1787 if (IS_ERR(page)) 1787 if (IS_ERR(page))
1788 return page; 1788 return page;
1789 mark_page_accessed(page);
1790 if (PageUptodate(page)) 1789 if (PageUptodate(page))
1791 goto out; 1790 goto out;
1792 1791