summaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
authorAnton Salikhmetov2008-01-23 00:21:18 +0100
committerLinus Torvalds2008-01-23 18:58:55 +0100
commit8f7b3d156d348b6766833cd4e272d0d19b501e64 (patch)
tree7569825ce2b5e95213d2b5abd2491f7b1667bdc2 /mm/memory.c
parentx86: GEODE fix a race condition in the MFGPT timer tick (diff)
downloadkernel-qcow2-linux-8f7b3d156d348b6766833cd4e272d0d19b501e64.tar.gz
kernel-qcow2-linux-8f7b3d156d348b6766833cd4e272d0d19b501e64.tar.xz
kernel-qcow2-linux-8f7b3d156d348b6766833cd4e272d0d19b501e64.zip
Update ctime and mtime for memory-mapped files
Update ctime and mtime for memory-mapped files at a write access on a present, read-only PTE, as well as at a write on a non-present PTE. Signed-off-by: Anton Salikhmetov <salikhmetov@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 6dd1cd88bfb6..4b0144b24c12 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1670,6 +1670,9 @@ gotten:
unlock:
pte_unmap_unlock(page_table, ptl);
if (dirty_page) {
+ if (vma->vm_file)
+ file_update_time(vma->vm_file);
+
/*
* Yes, Virginia, this is actually required to prevent a race
* with clear_page_dirty_for_io() from clearing the page dirty
@@ -2343,6 +2346,9 @@ out_unlocked:
if (anon)
page_cache_release(vmf.page);
else if (dirty_page) {
+ if (vma->vm_file)
+ file_update_time(vma->vm_file);
+
set_page_dirty_balance(dirty_page, page_mkwrite);
put_page(dirty_page);
}