aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-08-01 13:26:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-08-01 13:26:23 -0400
commita0e881b7c189fa2bd76c024dbff91e79511c971d (patch)
tree0c801918565b08921d21aceee5b326f64d998f5f /mm/memory.c
parenteff0d13f3823f35d70228cd151d2a2c89288ff32 (diff)
parentdbc6e0222d79e78925fe20733844a796a4b72cf9 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull second vfs pile from Al Viro: "The stuff in there: fsfreeze deadlock fixes by Jan (essentially, the deadlock reproduced by xfstests 068), symlink and hardlink restriction patches, plus assorted cleanups and fixes. Note that another fsfreeze deadlock (emergency thaw one) is *not* dealt with - the series by Fernando conflicts a lot with Jan's, breaks userland ABI (FIFREEZE semantics gets changed) and trades the deadlock for massive vfsmount leak; this is going to be handled next cycle. There probably will be another pull request, but that stuff won't be in it." Fix up trivial conflicts due to unrelated changes next to each other in drivers/{staging/gdm72xx/usb_boot.c, usb/gadget/storage_common.c} * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (54 commits) delousing target_core_file a bit Documentation: Correct s_umount state for freeze_fs/unfreeze_fs fs: Remove old freezing mechanism ext2: Implement freezing btrfs: Convert to new freezing mechanism nilfs2: Convert to new freezing mechanism ntfs: Convert to new freezing mechanism fuse: Convert to new freezing mechanism gfs2: Convert to new freezing mechanism ocfs2: Convert to new freezing mechanism xfs: Convert to new freezing code ext4: Convert to new freezing mechanism fs: Protect write paths by sb_start_write - sb_end_write fs: Skip atime update on frozen filesystem fs: Add freezing handling to mnt_want_write() / mnt_drop_write() fs: Improve filesystem freezing handling switch the protection of percpu_counter list to spinlock nfsd: Push mnt_want_write() outside of i_mutex btrfs: Push mnt_want_write() outside of i_mutex fat: Push mnt_want_write() outside of i_mutex ...
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 482f089765ff..57361708d1a5 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2650,6 +2650,9 @@ reuse:
2650 if (!page_mkwrite) { 2650 if (!page_mkwrite) {
2651 wait_on_page_locked(dirty_page); 2651 wait_on_page_locked(dirty_page);
2652 set_page_dirty_balance(dirty_page, page_mkwrite); 2652 set_page_dirty_balance(dirty_page, page_mkwrite);
2653 /* file_update_time outside page_lock */
2654 if (vma->vm_file)
2655 file_update_time(vma->vm_file);
2653 } 2656 }
2654 put_page(dirty_page); 2657 put_page(dirty_page);
2655 if (page_mkwrite) { 2658 if (page_mkwrite) {
@@ -2667,10 +2670,6 @@ reuse:
2667 } 2670 }
2668 } 2671 }
2669 2672
2670 /* file_update_time outside page_lock */
2671 if (vma->vm_file)
2672 file_update_time(vma->vm_file);
2673
2674 return ret; 2673 return ret;
2675 } 2674 }
2676 2675
@@ -3339,12 +3338,13 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
3339 3338
3340 if (dirty_page) { 3339 if (dirty_page) {
3341 struct address_space *mapping = page->mapping; 3340 struct address_space *mapping = page->mapping;
3341 int dirtied = 0;
3342 3342
3343 if (set_page_dirty(dirty_page)) 3343 if (set_page_dirty(dirty_page))
3344 page_mkwrite = 1; 3344 dirtied = 1;
3345 unlock_page(dirty_page); 3345 unlock_page(dirty_page);
3346 put_page(dirty_page); 3346 put_page(dirty_page);
3347 if (page_mkwrite && mapping) { 3347 if ((dirtied || page_mkwrite) && mapping) {
3348 /* 3348 /*
3349 * Some device drivers do not set page.mapping but still 3349 * Some device drivers do not set page.mapping but still
3350 * dirty their pages 3350 * dirty their pages
@@ -3353,7 +3353,7 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
3353 } 3353 }
3354 3354
3355 /* file_update_time outside page_lock */ 3355 /* file_update_time outside page_lock */
3356 if (vma->vm_file) 3356 if (vma->vm_file && !page_mkwrite)
3357 file_update_time(vma->vm_file); 3357 file_update_time(vma->vm_file);
3358 } else { 3358 } else {
3359 unlock_page(vmf.page); 3359 unlock_page(vmf.page);