lkml.org 
[lkml]   [2013]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] mm/slab: Fix /proc/slabinfo unwriteable for slab
On Mon, 24 Jun 2013, Wanpeng Li wrote:

> 1 file changed, 10 insertions(+)
>
> diff --git a/mm/slab_common.c b/mm/slab_common.c
> index d161b81..7fdde79 100644
> --- a/mm/slab_common.c
> +++ b/mm/slab_common.c
> @@ -631,10 +631,20 @@ static const struct file_operations proc_slabinfo_operations = {
> .release = seq_release,
> };
>
> +#ifdef CONFIG_SLAB
> +static int __init slab_proc_init(void)
> +{
> + proc_create("slabinfo", S_IWUSR | S_IRUSR, NULL, &proc_slabinfo_operations);
> + return 0;
> +}
> +#endif
> +#ifdef CONFIG_SLUB
> static int __init slab_proc_init(void)
> {
> proc_create("slabinfo", S_IRUSR, NULL, &proc_slabinfo_operations);
> return 0;
> }

It may be easier to define a macro SLABINFO_RIGHTS and use #ifdefs to
assign the correct one. That way we have only one slab_proc_init().


\
 
 \ /
  Last update: 2013-07-01 18:41    [W:1.079 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site