Date: Wed, 12 Mar 2014 15:36:30 +0000 From: "Meyer, Conrad" <conrad.meyer@isilon.com> To: Konstantin Belousov <kostikbel@gmail.com>, Conrad Meyer <cemeyer@uw.edu> Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>, Jeffrey Roberson <jeff@freebsd.org> Subject: RE: [PATCH 1/5] vm/device_pager.c: dev_pager_alloc: 'size' must be non-zero Message-ID: <A3CAF0E84A34A540B4C74454358E003F1292CEF3@MX103CL02.corp.emc.com> In-Reply-To: <20140312103009.GT24664@kib.kiev.ua> References: <1394583583-19023-1-git-send-email-conrad.meyer@isilon.com> <1394583583-19023-2-git-send-email-conrad.meyer@isilon.com>, <20140312103009.GT24664@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 12, 2014 at 3:30 AM, Konstantin Belousov <kostikbel@gmail.com> = wrote:=0A= >=0A= > Thank you for the submission, I committed four patches, except this one.= =0A= >=0A= =0A= Thanks!=0A= =0A= >=0A= > On Tue, Mar 11, 2014 at 05:19:39PM -0700, Conrad Meyer wrote:=0A= > > If size is zero, paddr is used uninitialized when assigning=0A= > > object1->pg_color.=0A= > So the issue there is only with non-managed device pager, right ?=0A= > Please note that GEM explicitely initializes color in the constructor.=0A= >=0A= > I do not like the change below, it puts the policy into pager, while=0A= > currently the decision is up to managed pager consumers, e.g. GEM,=0A= > which do the similar check on its own.=0A= >=0A= > I prefer a different way to shut down the warning, please see the=0A= > patch at the end of the message. Does it work for you ?=0A= >=0A= > diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c=0A= > index 13491ba..4cd245a 100644=0A= > --- a/sys/vm/device_pager.c=0A= > +++ b/sys/vm/device_pager.c=0A= > @@ -414,6 +414,7 @@ old_dev_pager_ctor(void *handle, vm_ooffset_t size, v= m_prot_t prot,=0A= > * XXX assumes VM_PROT_* =3D=3D PROT_*=0A= > */=0A= > npages =3D OFF_TO_IDX(size);=0A= > + paddr =3D 0; /* Make paddr initialized for the case of size =3D= =3D 0. */=0A= > for (off =3D foff; npages--; off +=3D PAGE_SIZE) {=0A= > if (csw->d_mmap(dev, off, &paddr, (int)prot, &dummy) !=3D= 0) {=0A= > dev_relthread(dev, ref);=0A= =0A= Looks good to me.=0A= =0A= Thanks,=0A= Conrad=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A3CAF0E84A34A540B4C74454358E003F1292CEF3>