Re: [PATCH 1/2] mm/compaction: Really limit compact_unevictable_allowed to 0…1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/3/20 9:20 PM, Sebastian Andrzej Siewior wrote:
> The proc file `compact_unevictable_allowed' should allow 0 and 1 only,
> the `extra*' attribues have been set properly but without
> proc_dointvec_minmax() as the `proc_handler' the limit will not be
> enforced.
> 
> Use proc_dointvec_minmax() as the `proc_handler' to enfoce the valid
> specified range.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>

Acked-by: Vlastimil Babka <vbabka@xxxxxxx>

> ---
>  kernel/sysctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index ad5b88a53c5a8..982203101f961 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -1484,7 +1484,7 @@ static struct ctl_table vm_table[] = {
>  		.data		= &sysctl_compact_unevictable_allowed,
>  		.maxlen		= sizeof(int),
>  		.mode		= 0644,
> -		.proc_handler	= proc_dointvec,
> +		.proc_handler	= proc_dointvec_minmax,
>  		.extra1		= SYSCTL_ZERO,
>  		.extra2		= SYSCTL_ONE,
>  	},
> 





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux