proc_dointvec: write a single value

The commit 00b7c3395aec3df43de5bd02a3c5a099ca51169f
"sysctl: refactor integer handling proc code"
modified the behaviour of writing to /proc.
Before the commit, write("1\n") to /proc/sys/kernel/printk succeeded. But
now it returns EINVAL.

This commit supports writing a single value to a multi-valued entry.

Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>
Reviewed-and-tested-by: WANG Cong <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by J. R. Okajima and committed by David S. Miller 563b0467 dd7496f2

+3 -1
+3 -1
kernel/sysctl.c
··· 2253 2253 if (write) { 2254 2254 left -= proc_skip_spaces(&kbuf); 2255 2255 2256 + if (!left) 2257 + break; 2256 2258 err = proc_get_long(&kbuf, &left, &lval, &neg, 2257 2259 proc_wspace_sep, 2258 2260 sizeof(proc_wspace_sep), NULL); ··· 2281 2279 2282 2280 if (!write && !first && left && !err) 2283 2281 err = proc_put_char(&buffer, &left, '\n'); 2284 - if (write && !err) 2282 + if (write && !err && left) 2285 2283 left -= proc_skip_spaces(&kbuf); 2286 2284 free: 2287 2285 if (write) {