Re: [PATCH 09/25] slub: make ->remote_node_defrag_ratio unsigned int

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

 



On Mon, 5 Mar 2018, Alexey Dobriyan wrote:

> ->remote_node_defrag_ratio is in range 0..1000.

This also adds a check and modifies the behavior to return an error code.
Before this patch invalid values were ignored.

Acked-by: Christoph Lameter <cl@xxxxxxxxx>

> -	err = kstrtoul(buf, 10, &ratio);
> +	err = kstrtouint(buf, 10, &ratio);
>  	if (err)
>  		return err;
> +	if (ratio > 100)
> +		return -ERANGE;
>
> -	if (ratio <= 100)
> -		s->remote_node_defrag_ratio = ratio * 10;
> +	s->remote_node_defrag_ratio = ratio * 10;
>
>  	return length;
>  }
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[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