Re: + sysctl-return-einval-if-val-violates-minmax.patch added to -mm tree

From: Alexey Dobriyan
Date: Mon Feb 11 2019 - 16:17:24 EST


On Mon, Feb 11, 2019 at 01:06:32PM -0800, akpm@xxxxxxxxxxxxxxxxxxxx wrote:

> @@ -2848,8 +2848,10 @@ static int __do_proc_doulongvec_minmax(v

> - if ((min && val < *min) || (max && val > *max))
> - continue;
> + if ((min && val < *min) || (max && val > *max)) {
> + err = -EINVAL;

I was asked to return ERANGE in kstrto*().
If nothing, it gives better error message:

$ ./a.out
foo: Numerical result out of range