mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* invalidate_inode_pages2
@ 2004-05-19  0:15 Andrea Arcangeli
  2004-05-19  0:27 ` invalidate_inode_pages2 Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Andrea Arcangeli @ 2004-05-19  0:15 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Something broke in invalidate_inode_pages2 between 2.4 and 2.6, this
causes malfunctions with mapped pages in 2.6.

I guess the below untested one liner should be enough to fix it. The
only single point of invalidate_inode_pages2, is to invalidate _mapped_
pages too. Otherwise we could as well use invalidate_inode_pages.
Clearly the dirty bit doesn't mean invalidate, invalidate primarly means
clearing the uptodate bitflag.

--- sles/mm/truncate.c.~1~	2004-05-18 19:24:40.000000000 +0200
+++ sles/mm/truncate.c	2004-05-19 02:09:28.311781864 +0200
@@ -260,9 +260,10 @@ void invalidate_inode_pages2(struct addr
 			if (page->mapping == mapping) {	/* truncate race? */
 				wait_on_page_writeback(page);
 				next = page->index + 1;
-				if (page_mapped(page))
+				if (page_mapped(page)) {
+					ClearPageUptodate(page);
 					clear_page_dirty(page);
-				else
+				} else
 					invalidate_complete_page(mapping, page);
 			}
 			unlock_page(page);

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-05-19  5:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-19  0:15 invalidate_inode_pages2 Andrea Arcangeli
2004-05-19  0:27 ` invalidate_inode_pages2 Andrew Morton
2004-05-19  0:51   ` invalidate_inode_pages2 Andrea Arcangeli
2004-05-19  1:00     ` invalidate_inode_pages2 Andrew Morton
2004-05-19  1:08       ` invalidate_inode_pages2 Andrea Arcangeli
2004-05-19  5:08     ` invalidate_inode_pages2 Jan Harkes
2004-05-19  5:16       ` invalidate_inode_pages2 Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®