Date: Wed, 20 Apr 2011 07:46:55 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Rick Macklem <rmacklem@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220877 - head/sys/fs/nfsclient Message-ID: <20110420054655.GD1826@garage.freebsd.pl> In-Reply-To: <201104200115.p3K1FMkJ028102@svn.freebsd.org> References: <201104200115.p3K1FMkJ028102@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--wLAMOaPNJ0fu1fTG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 20, 2011 at 01:15:22AM +0000, Rick Macklem wrote: > Author: rmacklem > Date: Wed Apr 20 01:15:22 2011 > New Revision: 220877 > URL: http://svn.freebsd.org/changeset/base/220877 >=20 > Log: > Modify the offset + size checks for read and write in the > experimental NFS client to take care of overflows for the calls > above the buffer cache layer in a manner similar to r220876. > Thanks go to dillon at apollo.backplane.com for providing the > snippet of code that does this. [...] > + tmp_off =3D uio->uio_offset + uio->uio_resid; > + mtx_lock(&nmp->nm_mtx); > + if (tmp_off > nmp->nm_maxfilesize || tmp_off < uio->uio_offset) { > + mtx_unlock(&nmp->nm_mtx); > return (EFBIG); > + } > + mtx_unlock(&nmp->nm_mtx); I don't think you need the lock to protect nm_maxfilesize. Can it change =66rom under us? My guess is that it is set on mount time and is not modified afterwards. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --wLAMOaPNJ0fu1fTG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk2uc08ACgkQForvXbEpPzSU5gCg9Hhw4p76BFJso+O2NcO//XmU 4F8AnjGeLA1kXi6RstTK8a8bIYW9LYVQ =JtAb -----END PGP SIGNATURE----- --wLAMOaPNJ0fu1fTG--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110420054655.GD1826>