aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWanpeng Li <liwanp@linux.vnet.ibm.com>2013-07-03 20:33:24 -0400
committerPekka Enberg <penberg@kernel.org>2013-07-07 11:37:47 -0400
commite9b4db2b8dba6b6c666e54b20ce46f3e597a6d96 (patch)
tree1e9862619ecbca7695558280bbd02637b1fea421
parente25839f67948ca54fa55a45686d72c266f65f099 (diff)
mm/slab: Fix /proc/slabinfo unwriteable for slab
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 <cl@linux.com> Signed-off-by: Wanpeng Li <liwanp@linux.vnet.ibm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r--mm/slab_common.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 68518eb67229..13ae037c71d4 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -495,6 +495,13 @@ void __init create_kmalloc_caches(unsigned long flags)
495 495
496 496
497#ifdef CONFIG_SLABINFO 497#ifdef CONFIG_SLABINFO
498
499#ifdef CONFIG_SLAB
500#define SLABINFO_RIGHTS (S_IWUSR | S_IRUSR)
501#else
502#define SLABINFO_RIGHTS S_IRUSR
503#endif
504
498void print_slabinfo_header(struct seq_file *m) 505void print_slabinfo_header(struct seq_file *m)
499{ 506{
500 /* 507 /*
@@ -631,7 +638,8 @@ static const struct file_operations proc_slabinfo_operations = {
631 638
632static int __init slab_proc_init(void) 639static int __init slab_proc_init(void)
633{ 640{
634 proc_create("slabinfo", S_IRUSR, NULL, &proc_slabinfo_operations); 641 proc_create("slabinfo", SLABINFO_RIGHTS, NULL,
642 &proc_slabinfo_operations);
635 return 0; 643 return 0;
636} 644}
637module_init(slab_proc_init); 645module_init(slab_proc_init);