mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] shrink_list: Use of && instead || leads to unintended writing of pages
@ 2006-01-20  0:05 Christoph Lameter
  2006-01-20  0:43 ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Lameter @ 2006-01-20  0:05 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

The check for laptop mode and sc->may_writepage is intended to not write
pages if either laptop mode is set or we are not allowed to write.

The && there means that currently pages may be written in laptop mode and during
zone_reclaim. This patch also applies to 2.6.15 and 2.6.14!

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.16-rc1-mm1/mm/vmscan.c
===================================================================
--- linux-2.6.16-rc1-mm1.orig/mm/vmscan.c	2006-01-19 15:40:28.000000000 -0800
+++ linux-2.6.16-rc1-mm1/mm/vmscan.c	2006-01-19 15:40:30.000000000 -0800
@@ -491,7 +491,7 @@ static int shrink_list(struct list_head 
 				goto keep_locked;
 			if (!may_enter_fs)
 				goto keep_locked;
-			if (laptop_mode && !sc->may_writepage)
+			if (laptop_mode || !sc->may_writepage)
 				goto keep_locked;
 
 			/* Page is dirty, try to write it out here */


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

end of thread, other threads:[~2006-01-20  2:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-20  0:05 [PATCH] shrink_list: Use of && instead || leads to unintended writing of pages Christoph Lameter
2006-01-20  0:43 ` Andrew Morton
2006-01-20  0:49   ` Christoph Lameter
2006-01-20  1:20     ` Andrew Morton
2006-01-20  1:30       ` Christoph Lameter
2006-01-20  1:46       ` Christoph Lameter
2006-01-20  2:27         ` Andrew Morton
2006-01-20  2:38           ` Christoph Lameter

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®