diff options
author | Anton Salikhmetov <salikhmetov@gmail.com> | 2008-01-22 18:21:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-01-23 12:58:55 -0500 |
commit | 8f7b3d156d348b6766833cd4e272d0d19b501e64 (patch) | |
tree | 7569825ce2b5e95213d2b5abd2491f7b1667bdc2 | |
parent | 667984d9e481e43a930a478c588dced98cb61fea (diff) |
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>
-rw-r--r-- | mm/memory.c | 6 |
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: | |||
1670 | unlock: | 1670 | unlock: |
1671 | pte_unmap_unlock(page_table, ptl); | 1671 | pte_unmap_unlock(page_table, ptl); |
1672 | if (dirty_page) { | 1672 | if (dirty_page) { |
1673 | if (vma->vm_file) | ||
1674 | file_update_time(vma->vm_file); | ||
1675 | |||
1673 | /* | 1676 | /* |
1674 | * Yes, Virginia, this is actually required to prevent a race | 1677 | * Yes, Virginia, this is actually required to prevent a race |
1675 | * with clear_page_dirty_for_io() from clearing the page dirty | 1678 | * with clear_page_dirty_for_io() from clearing the page dirty |
@@ -2343,6 +2346,9 @@ out_unlocked: | |||
2343 | if (anon) | 2346 | if (anon) |
2344 | page_cache_release(vmf.page); | 2347 | page_cache_release(vmf.page); |
2345 | else if (dirty_page) { | 2348 | else if (dirty_page) { |
2349 | if (vma->vm_file) | ||
2350 | file_update_time(vma->vm_file); | ||
2351 | |||
2346 | set_page_dirty_balance(dirty_page, page_mkwrite); | 2352 | set_page_dirty_balance(dirty_page, page_mkwrite); |
2347 | put_page(dirty_page); | 2353 | put_page(dirty_page); |
2348 | } | 2354 | } |