diff options
| author | Wanpeng Li <liwanp@linux.vnet.ibm.com> | 2013-07-04 08:33:24 +0800 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2016-09-28 15:14:25 +0200 |
| commit | 250935a51002a8bc179330cf98cdb44b399a20e4 (patch) | |
| tree | 291a3ac1aac15ff10c403e2ddd9b169c823da307 | |
| parent | bd54c62f5eb560ebacb990b962cfd4fd4c6bbc14 (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>
Signed-off-by: W4TCH0UT <ateekujjawal@gmail.com>
| -rw-r--r-- | mm/slab_common.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index cbf346437..7392d4cbd 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -501,6 +501,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) { /* @@ -637,7 +644,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); |
