Prev: staging: remove all code dependent on LINUX_VERSION_CODE
Next: TTY/n_gsm: potential double lock
From: Cong Wang on 25 May 2010 08:20 On 05/25/10 14:49, J. R. Okajima wrote: > 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(a)yahoo.co.jp> Reviewed-and-tested-by: WANG Cong <amwang(a)redhat.com> Thanks a lot! > --- > kernel/sysctl.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/kernel/sysctl.c b/kernel/sysctl.c > index 4c93486..78ac3fb 100644 > --- a/kernel/sysctl.c > +++ b/kernel/sysctl.c > @@ -2262,6 +2262,8 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, > if (write) { > left -= proc_skip_spaces(&kbuf); > > + if (!left) > + break; > err = proc_get_long(&kbuf,&left,&lval,&neg, > proc_wspace_sep, > sizeof(proc_wspace_sep), NULL); > @@ -2288,7 +2290,7 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, > > if (!write&& !first&& left&& !err) > err = proc_put_char(&buffer,&left, '\n'); > - if (write&& !err) > + if (write&& !err&& left) > left -= proc_skip_spaces(&kbuf); > free: > if (write) { -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: David Miller on 25 May 2010 19:20 From: Cong Wang <amwang(a)redhat.com> Date: Tue, 25 May 2010 20:23:47 +0800 > On 05/25/10 14:49, J. R. Okajima wrote: >> 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(a)yahoo.co.jp> > > Reviewed-and-tested-by: WANG Cong <amwang(a)redhat.com> Since the regression causing change came in via the net tree I'll integrate this fix too, applied, thanks! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Eric W. Biederman on 30 May 2010 11:10 David Miller <davem(a)davemloft.net> writes: > From: Cong Wang <amwang(a)redhat.com> > Date: Tue, 25 May 2010 20:23:47 +0800 > >> On 05/25/10 14:49, J. R. Okajima wrote: >>> 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(a)yahoo.co.jp> >> >> Reviewed-and-tested-by: WANG Cong <amwang(a)redhat.com> > > Since the regression causing change came in via the net tree > I'll integrate this fix too, applied, thanks! Thanks, guys for fixing this. I hate to see my review comments show up like this in practice. I had really hoped those unnecessary changes to proc would have been dropped from that patchset. Oh well. Eric -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|
Pages: 1 Prev: staging: remove all code dependent on LINUX_VERSION_CODE Next: TTY/n_gsm: potential double lock |