[PATCH 3/5] lumpy: ensure that we compare PageActive and active safely

From: Andy Whitcroft
Date: Tue Feb 27 2007 - 14:36:11 EST



Now that we are passing in a boolean active flag we need to
ensure that the result of PageActive(page) is comparible
to that boolean.

Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxx>
---
diff --git a/mm/vmscan.c b/mm/vmscan.c
index b878d54..2bfad79 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -632,7 +632,12 @@ static int __isolate_lru_page(struct page *page, int active)
{
int ret = -EINVAL;

- if (PageLRU(page) && (PageActive(page) == active)) {
+ /*
+ * When checking the active state, we need to be sure we are
+ * dealing with comparible boolean values. Take the logical not
+ * of each.
+ */
+ if (PageLRU(page) && (!PageActive(page) == !active)) {
ret = -EBUSY;
if (likely(get_page_unless_zero(page))) {
/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/