Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Aug 2010 02:46:51 -0700
From:      Brian Somers <brian@FreeBSD.org>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject:   Re: svn commit: r211684 - head/sys/kern
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>

next in thread | previous in thread | raw e-mail | index | archive | help
--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 <kostikbel@gmail.com> 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                                          <brian@Awfulhak.org>
Don't _EVER_ lose your sense of humour !               <brian@FreeBSD.org>

--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+--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100825024651.288b67b5>