Date: Wed, 20 Mar 2013 15:22:22 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: Michael Landin Hostbaek <mich@FreeBSD.org> Cc: Jeremy Chadwick <jdc@koitsu.org>, Rick Macklem <rmacklem@uoguelph.ca>, freebsd-stable@FreeBSD.org, Andriy Gapon <avg@FreeBSD.org>, John Baldwin <jhb@FreeBSD.org> Subject: Re: Core Dump / panic sleeping thread Message-ID: <20130320132222.GC3794@kib.kiev.ua> In-Reply-To: <424B99CB-A6D3-4219-A21E-62E5FB778E82@FreeBSD.org> References: <5148A454.1080303@FreeBSD.org> <153890828.4081736.1363736263509.JavaMail.root@erie.cs.uoguelph.ca> <20130320094954.GV3794@kib.kiev.ua> <424B99CB-A6D3-4219-A21E-62E5FB778E82@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--FqaIGMzVeQkeDzz8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 20, 2013 at 12:13:05PM +0100, Michael Landin Hostbaek wrote: >=20 > On Mar 20, 2013, at 10:49 AM, Konstantin Belousov <kostikbel@gmail.com> w= rote: > >=20 > > I do not like it. As I said in the previous response to Andrey, > > I think that moving the vnode_pager_setsize() after the unlock is > > better, since it reduces races with other thread seeing half-done > > attribute update or making attribute change simultaneously. >=20 > OK - so should I wait for another patch - or?=20 I think the following is what I mean. As an additional note, why nfs client does not trim the buffers when server reported node size change ? diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index a07a67f..4fe2e35 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -361,6 +361,8 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr= *nap, void *nvaper, struct nfsnode *np; struct nfsmount *nmp; struct timespec mtime_save; + u_quad_t nsize; + int setnsize; =20 /* * If v_type =3D=3D VNON it is a new node, so fill in the v_type, @@ -418,6 +420,7 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr= *nap, void *nvaper, } else vap->va_fsid =3D vp->v_mount->mnt_stat.f_fsid.val[0]; np->n_attrstamp =3D time_second; + setnsize =3D 0; if (vap->va_size !=3D np->n_size) { if (vap->va_type =3D=3D VREG) { if (dontshrink && vap->va_size < np->n_size) { @@ -444,10 +447,13 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvat= tr *nap, void *nvaper, np->n_size =3D vap->va_size; np->n_flag |=3D NSIZECHANGED; } - vnode_pager_setsize(vp, np->n_size); } else { np->n_size =3D vap->va_size; } + if (vap->va_type =3D=3D VREG || vap->va_type =3D=3D VDIR) { + setnsize =3D 1; + nsize =3D vap->va_size; + } } /* * The following checks are added to prevent a race between (say) @@ -480,6 +486,8 @@ nfscl_loadattrcache(struct vnode **vpp, struct nfsvattr= *nap, void *nvaper, KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, vap, 0); #endif NFSUNLOCKNODE(np); + if (setnsize) + vnode_pager_setsize(vp, nsize); return (0); } =20 --FqaIGMzVeQkeDzz8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRSbgNAAoJEJDCuSvBvK1B1DAQAJhalngZXNaZ5/QiS/0mC4BE k7P8UX/ukBZszZKni2YP4avrFTIIIPmRaJ5zR0BaoXO8MBq2fVob3MUB+ALdYmWm L/KrCB9+o/65yXQPTIZLCdBiCyv79ahLSXNz8qH5MCuyAOaJXC24AGKdLewRsAmX tHOErjdKSTZF1B1tSorPBy7TSTV5w/PCgWigdWUmTUOh6W2ORKe6QX4mZ01KprTe tSGX+ONd9rImQPao2ZbcbqGo6bfrH3lM5FxzhIn0FlQ93FQaVPr8C6OM87f3Z90T mu69C6eo50AJ2enGJTJxdKn3RllPVuCPIiupggjG4d+gb35yAd3LRh6lcrpvZQBm 0RkvOV69Em4Xjt74pCiLZYqco9dI2/dDbemsnHMJ2aRBYsKqURej4DxV/wmNDc1S +6z0zjenSuHp+JdiZVk7zbsu1AhqRH86JiH6omvAQeMazIe7aRsFs/ii9oYp05nf MhJSupjiDFva+tkbFD9e21LF13XSHrvQxYQexGDUu7cnij6WJalMdYfzwG3wVG7h HPiH5+h8fSC7q1rJJ+qrsY5vOgcGV71+YLPJP9b24PYiEOjAfQofaolobVo0klYK Q8VJEIYaPZV8U+zLf3+kPMapWgzYhJkqPOjyYuJZFlGmifdPIyNr+6e+6ef/XSgi /cIgbNo5CPsdVKMDMSir =U0zL -----END PGP SIGNATURE----- --FqaIGMzVeQkeDzz8--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130320132222.GC3794>