Skip to content

Commit

Permalink
mm/slab: Fix /proc/slabinfo unwriteable for slab
Browse files Browse the repository at this point in the history
Slab have some tunables like limit, batchcount, and sharedfactor can be
tuned through function slabinfo_write. Commit (b7454ad: 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>
  • Loading branch information
Wanpeng Li authored and Pekka Enberg committed Jul 7, 2013
1 parent e25839f commit e9b4db2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mm/slab_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,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)
{
/*
Expand Down Expand Up @@ -631,7 +638,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);
Expand Down

0 comments on commit e9b4db2

Please sign in to comment.