From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 10:03:40 2010 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 B85EC106567A; Wed, 25 Aug 2010 10:03:40 +0000 (UTC) (envelope-from prvs=1846a26b27=brian@FreeBSD.org) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id 612898FC19; Wed, 25 Aug 2010 10:03:40 +0000 (UTC) Received: from pd2ml1so-ssvc.prod.shaw.ca ([10.0.141.139]) by pd3mo1so-svcs.prod.shaw.ca with ESMTP; 25 Aug 2010 03:48:38 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=6EkEX6JM2LCztCEhkE317K9SpBSN4cB8nbuuHVfFIzI= c=1 sm=1 a=ac2em_AgDcUA:10 a=VphdPIyG4kEA:10 a=MJPcHhXccCG8eBs0us8XwA==:17 a=pGLkceISAAAA:8 a=6I5d2MoRAAAA:8 a=MMwg4So0AAAA:8 a=R6JeLM4sqc3GGkWqVeYA:9 a=OpXzp7ce0wvinjQXv7xuH7slwvoA:4 a=CjuIK1q_8ugA:10 a=MSl-tDqOz04A:10 a=WJ3hkfHDukgA:10 a=SV7veod9ZcQA:10 a=g5MSwxJAP8RBvM5y_GoA:9 a=ncedj2dnlp0M_f2ao4yuYJy9C9YA:4 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO store.lan.Awfulhak.org) ([70.79.162.198]) by pd2ml1so-dmz.prod.shaw.ca with ESMTP; 25 Aug 2010 03:48:37 -0600 Received: from store.lan.Awfulhak.org (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id 32F3FC433B1_C74E68FB; Wed, 25 Aug 2010 09:46:55 +0000 (GMT) Received: from gw.Awfulhak.org (gw.lan.Awfulhak.org [172.16.0.1]) by store.lan.Awfulhak.org (Sophos Email Appliance) with ESMTP id A7F02C4612C_C74E68BF; Wed, 25 Aug 2010 09:46:51 +0000 (GMT) Received: from dev.lan.Awfulhak.org (brian@dev.lan.Awfulhak.org [172.16.0.5]) by gw.Awfulhak.org (8.14.4/8.14.4) with ESMTP id o7P9kppY010758; Wed, 25 Aug 2010 02:46:51 -0700 (PDT) (envelope-from brian@FreeBSD.org) Date: Wed, 25 Aug 2010 02:46:51 -0700 From: Brian Somers To: Kostik Belousov Message-ID: <20100825024651.288b67b5@dev.lan.Awfulhak.org> In-Reply-To: <20100823102858.GD2396@deviant.kiev.zoral.com.ua> References: <201008230533.o7N5XVxa028293@svn.freebsd.org> <20100823102858.GD2396@deviant.kiev.zoral.com.ua> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i386-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/yT/_rJXsc4uuF.p/1dzuPV+"; protocol="application/pgp-signature" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211684 - 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: Wed, 25 Aug 2010 10:03:40 -0000 --Sig_/yT/_rJXsc4uuF.p/1dzuPV+ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Mon, 23 Aug 2010 13:28:58 +0300 Kostik Belousov wr= ote: > On Mon, Aug 23, 2010 at 05:33:31AM +0000, Brian Somers wrote: > > Author: brian > > Date: Mon Aug 23 05:33:31 2010 > > New Revision: 211684 > > URL: http://svn.freebsd.org/changeset/base/211684 > >=20 > > Log: > > uio_resid isn't updated by VOP_READDIR for nfs filesystems. Use > > the uio_offset adjustment instead to calculate a correct *len. > Isn't this should be fixed in nfs instead ? Please note that the moral > equivalent of the code is also present in compat/linux/linux_cwd.c: > linux_getcwd_scandir(). I did not inspected other callers of > VOP_READDIR. >=20 > > =20 > > Without this change, we run off the end of the directory data > > we're reading and panic horribly for nfs filesystems. > > =20 > > MFC after: 1 week > >=20 > > Modified: > > head/sys/kern/vfs_default.c > >=20 > > Modified: head/sys/kern/vfs_default.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/vfs_default.c Mon Aug 23 05:33:20 2010 (r211683) > > +++ head/sys/kern/vfs_default.c Mon Aug 23 05:33:31 2010 (r211684) > > @@ -281,10 +281,9 @@ get_next_dirent(struct vnode *vp, struct > > if (error) > > return (error); > > =20 > > - *off =3D uio.uio_offset; > > - > > *cpos =3D dirbuf; > > - *len =3D (dirbuflen - uio.uio_resid); > > + *len =3D uio.uio_offset - *off; > > + *off =3D uio.uio_offset; > > } > > =20 > > dp =3D (struct dirent *)(*cpos); I'm looking into why uio_resid isn't being updated - it's a bit awkward as this is happening on a production box running 8.1 (just upgraded from 7), so it may take a few days. --=20 Brian Somers Don't _EVER_ lose your sense of humour ! --Sig_/yT/_rJXsc4uuF.p/1dzuPV+ Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQCVAwUBTHTmiw7tvOdmanQhAQJMogP/SC2uLk3r3nOyJFsvHqdbu261T0BqGDBV foM72NRr0F2Fg97DWmEkjraU7mhHKJRynk9s1YBqrwV1856UWUdlnrc/91lcFpdO DOdnliNRtcUdfuS8UeqsfaHPFeSLAhmfLCK32X5Xo7naqix8CxRhyMTIjcbqoQtD pgeHIpAme2I= =4klp -----END PGP SIGNATURE----- --Sig_/yT/_rJXsc4uuF.p/1dzuPV+--