[linux-mm-cc] [RFC PATCH] Fix inconsistency at initialization of anon-cc

IKEDA Munehiro m-ikeda at ds.jp.nec.com
Wed May 9 01:02:40 EDT 2007


Hi all,

In sysctl_max_anon_cc_size(), it seems that anon_cc_started should be set
"true" only if set_anon_cc_size() returned successfully, but it isn't.
The patch below corrects it.
I'm not sure whether the unconditional operation is designed or not
... how do you think about it?

This patch is for patch-ccache-alpha-008-2.6.21 applied kernel.

Best regards,
IKEDA, Munehiro



>From ba6ff89be395c8e09262231444c81778416714f3 Mon Sep 17 00:00:00 2001
From: IKEDA, Munehiro <m-ikeda at ds.jp.nec.com>
Date: Tue, 8 May 2007 11:46:01 +0900
Subject: [RFC PATCH] Fix inconsistency at initialization of anon-cc

anon_cc_started should be set 1 only if set_anon_cc_size()
returned 0, which means successful return.
But it was always set 1 whichever set_anon_cc_size() returned
in sysctl_max_anon_cc_size().
This patch fixes this inconsistency.
---
 mm/ccache.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/ccache.c b/mm/ccache.c
index a5e53ca..2d20b2c 100644
--- a/mm/ccache.c
+++ b/mm/ccache.c
@@ -462,8 +462,9 @@ int sysctl_max_anon_cc_size(ctl_table *t
        if (!write)
                goto out;
        ret = set_anon_cc_size(max_anon_cc_size);
-       if (!ret)
-               CC_INFO("Max anon ccache size: %lu pages", max_anon_cc_size);
+       if (ret)
+               goto out;
+       CC_INFO("Max anon ccache size: %lu pages", max_anon_cc_size);
        anon_cc_started=1;
 out:
        return ret;
-- 
1.4.0









More information about the linux-mm-cc mailing list