aboutsummaryrefslogtreecommitdiffstats
path: root/mm/truncate.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-09-13 09:55:09 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-09-13 09:55:09 -0400
commit0bc0748dfbefacce9c6b67ab23f2c80133b598f7 (patch)
tree76946adc08a26973fcdb39fe0eb3ef5e1f8f121d /mm/truncate.c
parentb6397893a5ed81970e803d61ee2f1a0e79f87438 (diff)
parent95064a75ebf8744e1ff595e8cd7ff9b6c851523e (diff)
Merge branch 'master' into gfs2
Diffstat (limited to 'mm/truncate.c')
-rw-r--r--mm/truncate.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/truncate.c b/mm/truncate.c
index cf1b015df4a7..c6ab55ec6883 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -68,10 +68,10 @@ invalidate_complete_page(struct address_space *mapping, struct page *page)
68 return 0; 68 return 0;
69 69
70 write_lock_irq(&mapping->tree_lock); 70 write_lock_irq(&mapping->tree_lock);
71 if (PageDirty(page)) { 71 if (PageDirty(page))
72 write_unlock_irq(&mapping->tree_lock); 72 goto failed;
73 return 0; 73 if (page_count(page) != 2) /* caller's ref + pagecache ref */
74 } 74 goto failed;
75 75
76 BUG_ON(PagePrivate(page)); 76 BUG_ON(PagePrivate(page));
77 __remove_from_page_cache(page); 77 __remove_from_page_cache(page);
@@ -79,6 +79,9 @@ invalidate_complete_page(struct address_space *mapping, struct page *page)
79 ClearPageUptodate(page); 79 ClearPageUptodate(page);
80 page_cache_release(page); /* pagecache ref */ 80 page_cache_release(page); /* pagecache ref */
81 return 1; 81 return 1;
82failed:
83 write_unlock_irq(&mapping->tree_lock);
84 return 0;
82} 85}
83 86
84/** 87/**