Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933461Ab3GDAdo (ORCPT ); Wed, 3 Jul 2013 20:33:44 -0400 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:34165 "EHLO e23smtp01.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756394Ab3GDAdm (ORCPT ); Wed, 3 Jul 2013 20:33:42 -0400 From: Wanpeng Li To: Pekka Enberg , Christoph Lameter , Matt Mackall Cc: Glauber Costa , Andrew Morton , Joonsoo Kim , David Rientjes , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wanpeng Li Subject: [PATCH v3 3/5] mm/slab: Fix /proc/slabinfo unwriteable for slab Date: Thu, 4 Jul 2013 08:33:24 +0800 Message-Id: <1372898006-6308-3-git-send-email-liwanp@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1372898006-6308-1-git-send-email-liwanp@linux.vnet.ibm.com> References: <1372898006-6308-1-git-send-email-liwanp@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13070400-1618-0000-0000-00000433AE21 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1459 Lines: 47 Slab have some tunables like limit, batchcount, and sharedfactor can be tuned through function slabinfo_write. Commit (b7454ad3: mm/sl[au]b: Move slabinfo processing to slab_common.c) uncorrectly change /proc/slabinfo unwriteable for slab, this patch fix it by revert to original mode. Acked-by: Christoph Lameter Signed-off-by: Wanpeng Li --- mm/slab_common.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mm/slab_common.c b/mm/slab_common.c index d161b81..6a2e530 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -497,6 +497,13 @@ void __init create_kmalloc_caches(unsigned long flags) #ifdef CONFIG_SLABINFO + +#ifdef CONFIG_SLAB +#define SLABINFO_RIGHTS (S_IWUSR | S_IRUSR) +#else +#define SLABINFO_RIGHTS S_IRUSR +#endif + void print_slabinfo_header(struct seq_file *m) { /* @@ -633,7 +640,8 @@ static const struct file_operations proc_slabinfo_operations = { static int __init slab_proc_init(void) { - proc_create("slabinfo", S_IRUSR, NULL, &proc_slabinfo_operations); + proc_create("slabinfo", SLABINFO_RIGHTS, NULL, + &proc_slabinfo_operations); return 0; } module_init(slab_proc_init); -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/