From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 12:37:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1D9F1065672; Sat, 28 Jan 2012 12:37:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 4A3E48FC18; Sat, 28 Jan 2012 12:37:54 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0SCbmWQ015177 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Jan 2012 14:37:49 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q0SCbmYD069884; Sat, 28 Jan 2012 14:37:48 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0SCbmcm069883; Sat, 28 Jan 2012 14:37:48 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Jan 2012 14:37:48 +0200 From: Kostik Belousov To: Bruce Evans , Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <20120128123748.GD2726@deviant.kiev.zoral.com.ua> References: <201201261159.q0QBxma2086162@svn.freebsd.org> <20120126233110.C960@besplex.bde.org> <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WG0/bXtUnGTsWt66" Content-Disposition: inline In-Reply-To: <20120127194221.GA25723@zim.MIT.EDU> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 12:37:56 -0000 --WG0/bXtUnGTsWt66 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote: > On Fri, Jan 27, 2012, Kostik Belousov wrote: > > On Fri, Jan 27, 2012 at 07:50:30PM +1100, Bruce Evans wrote: > > > On Thu, 26 Jan 2012, Gleb Smirnoff wrote: > > >=20 > > > >On Thu, Jan 26, 2012 at 11:53:57PM +1100, Bruce Evans wrote: > > > >B> > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct aio > > > >B> > return (error); > > > >B> > } > > > >B> > > > > >B> > + /* XXX: aio_nbytes is later casted to signed types. */ > > > >B> > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { > > > >B> > > > >B> This should avoid implementation-defined behaviour by checking if > > > >B> > > > >B> (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. > > >=20 > > > >Is the attached patch okay? > > >=20 > > > Yes. It now matches the style used for read^Wsys_read() and friends. > > > This used to have to fit the count in "int uio_resid". uio_resid now > > > has type ssize_t, but for some reason the old INT_MAX limits remain. > >=20 > > Well, I can revive the patch. I still think it is good to get rid of > > the limit. >=20 > The correct limit on the maximum size of a single read/write is > SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to raise the > limit yet, though, because of bugs in several filesystems. For > example, FFS copies uio_resid into a local variable of type int. > I have some old patches that fix some of these issues for FFS and > cd9660, but surely there are more places I didn't notice. >=20 Absolutely agree. http://people.freebsd.org/~kib/misc/uio_resid.5.patch > By the way, PR 147226 is about this. --WG0/bXtUnGTsWt66 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8j7BwACgkQC3+MBN1Mb4gMhwCdGlXt/sCwdu41akDwe8BE0UNZ nD4AoOsD1S7HrVjHmYj7j41/iA6rJ3fv =aI3x -----END PGP SIGNATURE----- --WG0/bXtUnGTsWt66--