Date: Tue, 26 Oct 2010 19:43:03 -0700 From: Garrett Cooper <gcooper@FreeBSD.org> To: David Xu <davidxu@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r214409 - head/sys/kern Message-ID: <AANLkTi=2dTVmB8Goj%2BNXq4F6SmZBNS3bxn8gLjmQ%2BdfV@mail.gmail.com> In-Reply-To: <201010270232.o9R2Wsu3084553@svn.freebsd.org> References: <201010270232.o9R2Wsu3084553@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 26, 2010 at 7:32 PM, David Xu <davidxu@freebsd.org> wrote: > Author: davidxu > Date: Wed Oct 27 02:32:54 2010 > New Revision: 214409 > URL: http://svn.freebsd.org/changeset/base/214409 > > Log: > =A0If input parameter cpusetsize is zero, give userland size of cpuset ma= sk > =A0kernel is using. > > Modified: > =A0head/sys/kern/kern_cpuset.c > > Modified: head/sys/kern/kern_cpuset.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_cpuset.c Wed Oct 27 02:07:25 2010 =A0 =A0 =A0 =A0(= r214408) > +++ head/sys/kern/kern_cpuset.c Wed Oct 27 02:32:54 2010 =A0 =A0 =A0 =A0(= r214409) > @@ -889,6 +889,10 @@ cpuset_getaffinity(struct thread *td, st > =A0 =A0 =A0 =A0int error; > =A0 =A0 =A0 =A0size_t size; > > + =A0 =A0 =A0 if (uap->cpusetsize =3D=3D 0) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 td->td_retval[0] =3D sizeof(cpuset_t); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (0); > + =A0 =A0 =A0 } > =A0 =A0 =A0 =A0if (uap->cpusetsize < sizeof(cpuset_t) || > =A0 =A0 =A0 =A0 =A0 =A0uap->cpusetsize > CPU_MAXSIZE / NBBY) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (ERANGE); Isn't this requirement partly broken now? [ERANGE] The cpusetsize was either preposterously large or smaller than the kernel set size. Why should cpuset(2) be broken in favor of people not passing valid val= ues? Thanks, -Garrett
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTi=2dTVmB8Goj%2BNXq4F6SmZBNS3bxn8gLjmQ%2BdfV>