Re: Anyone seeing any NFS lockups/weirdness with latest (ish) current??

From: Poul-Henning Kamp <phk_at_phk.freebsd.dk>
Date: Fri, 24 Oct 2003 13:30:18 +0200
In message <20031024111903.GA2554_at_stack.nl>, Marc Olzheim writes:
>On Thu, Oct 23, 2003 at 10:53:29PM +0200, Soren Schmidt wrote:
>> Yes, NFS is locking up here as well between current machines thats been 
>> updated in the last 24 hours...
>
>In kernels since about october 17th, until upto an hour ago, it's still
>reproducable here as well..

You may want to try this patch, Kirk sent it to me in response to a
case where my NFS-server hung during snapshot processing.

I have only just managed to put it on my server so I don't know if
it solves the problem or not.

Poul-Henning


Index: nfs_serv.c
===================================================================
RCS file: /home/ncvs/src/sys/nfsserver/nfs_serv.c,v
retrieving revision 1.136
diff -u -r1.136 nfs_serv.c
--- nfs_serv.c	24 Jun 2003 19:04:26 -0000	1.136
+++ nfs_serv.c	24 Oct 2003 11:14:56 -0000
_at__at_ -310,13 +310,7 _at__at_
 		error = ESTALE;
 		goto out;
 	}
-	if ((error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp)) != 0) {
-		mp = NULL;
-		goto out;
-	}
-	(void) vn_start_write(vp, &mp, V_WAIT);
-	vput(vp);
-	vp = NULL;
+	(void) vn_start_write(NULL, &mp, V_WAIT);
 	VATTR_NULL(vap);
 	if (v3) {
 		nfsm_srvsattr(vap);
_at__at_ -1010,13 +1004,7 _at__at_
 		error = ESTALE;
 		goto ereply;
 	}
-	if ((error = VFS_FHTOVP(mntp, &fhp->fh_fid, &vp)) != 0) {
-		mntp = NULL;
-		goto ereply;
-	}
-	(void) vn_start_write(vp, &mntp, V_WAIT);
-	vput(vp);
-	vp = NULL;
+	(void) vn_start_write(NULL, &mntp, V_WAIT);
 	if (v3) {
 		tl = nfsm_dissect(u_int32_t *, 5 * NFSX_UNSIGNED);
 		off = fxdr_hyper(tl);
_at__at_ -1588,7 +1576,6 _at__at_
 	u_quad_t tempsize;
 	u_char cverf[NFSX_V3CREATEVERF];
 	struct mount *mp = NULL;
-	struct vnode *vp;
 
 	nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
 #ifndef nolint
_at__at_ -1602,12 +1589,7 _at__at_
 		error = ESTALE;
 		goto ereply;
 	}
-	if ((error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp)) != 0) {
-		mp = NULL;
-		goto ereply;
-	}
-	(void) vn_start_write(vp, &mp, V_WAIT);
-	vput(vp);
+	(void) vn_start_write(NULL, &mp, V_WAIT);
 	nfsm_srvnamesiz(len);
 
 	nd.ni_cnd.cn_cred = cred;
_at__at_ -1891,13 +1873,7 _at__at_
 		error = ESTALE;
 		goto ereply;
 	}
-	if ((error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp)) != 0) {
-		mp = NULL;
-		goto ereply;
-	}
-	(void) vn_start_write(vp, &mp, V_WAIT);
-	vput(vp);
-	vp = NULL;
+	(void) vn_start_write(NULL, &mp, V_WAIT);
 	nfsm_srvnamesiz(len);
 
 	nd.ni_cnd.cn_cred = cred;
_at__at_ -2064,7 +2040,6 _at__at_
 	nfsfh_t nfh;
 	fhandle_t *fhp;
 	struct mount *mp = NULL;
-	struct vnode *vp;
 
 	nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
 	ndclear(&nd);
_at__at_ -2075,13 +2050,7 _at__at_
 		error = ESTALE;
 		goto ereply;
 	}
-	if ((error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp)) != 0) {
-		mp = NULL;
-		goto ereply;
-	}
-	(void) vn_start_write(vp, &mp, V_WAIT);
-	vput(vp);
-	vp = NULL;
+	(void) vn_start_write(NULL, &mp, V_WAIT);
 	nfsm_srvnamesiz(len);
 
 	nd.ni_cnd.cn_cred = cred;
_at__at_ -2178,7 +2147,6 _at__at_
 	fhandle_t *ffhp, *tfhp;
 	uid_t saved_uid;
 	struct mount *mp = NULL;
-	struct vnode *vp;
 
 	nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
 #ifndef nolint
_at__at_ -2199,13 +2167,7 _at__at_
 		error = ESTALE;
 		goto out1;
 	}
-	if ((error = VFS_FHTOVP(mp, &ffhp->fh_fid, &vp)) != 0) {
-		mp = NULL;
-		goto out1;
-	}
-	(void) vn_start_write(vp, &mp, V_WAIT);
-	vput(vp);
-	vp = NULL;
+	(void) vn_start_write(NULL, &mp, V_WAIT);
 	nfsm_srvnamesiz(len);
 	/*
 	 * Remember our original uid so that we can reset cr_uid before
_at__at_ -2421,13 +2383,7 _at__at_
 		error = ESTALE;
 		goto ereply;
 	}
-	if ((error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp)) != 0) {
-		mp = NULL;
-		goto ereply;
-	}
-	(void) vn_start_write(vp, &mp, V_WAIT);
-	vput(vp);
-	vp = NULL;
+	(void) vn_start_write(NULL, &mp, V_WAIT);
 	nfsm_srvmtofh(dfhp);
 	nfsm_srvnamesiz(len);
 
_at__at_ -2559,7 +2515,6 _at__at_
 	nfsfh_t nfh;
 	fhandle_t *fhp;
 	struct mount *mp = NULL;
-	struct vnode *vp;
 
 	nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
 	ndclear(&nd);
_at__at_ -2570,13 +2525,7 _at__at_
 		error = ESTALE;
 		goto out;
 	}
-	if ((error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp)) != 0) {
-		mp = NULL;
-		goto out;
-	}
-	(void) vn_start_write(vp, &mp, V_WAIT);
-	vput(vp);
-	vp = NULL;
+	(void) vn_start_write(NULL, &mp, V_WAIT);
 	nfsm_srvnamesiz(len);
 	nd.ni_cnd.cn_cred = cred;
 	nd.ni_cnd.cn_nameiop = CREATE;
_at__at_ -2738,7 +2687,6 _at__at_
 	nfsfh_t nfh;
 	fhandle_t *fhp;
 	struct mount *mp = NULL;
-	struct vnode *vp;
 
 	nfsdbprintf(("%s %d\n", __FILE__, __LINE__));
 	ndclear(&nd);
_at__at_ -2749,13 +2697,7 _at__at_
 		error = ESTALE;
 		goto out;
 	}
-	if ((error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp)) != 0) {
-		mp = NULL;
-		goto out;
-	}
-	(void) vn_start_write(vp, &mp, V_WAIT);
-	vput(vp);
-	vp = NULL;
+	(void) vn_start_write(NULL, &mp, V_WAIT);
 	nfsm_srvnamesiz(len);
 	nd.ni_cnd.cn_cred = cred;
 	nd.ni_cnd.cn_nameiop = CREATE;
_at__at_ -2908,13 +2850,7 _at__at_
 		error = ESTALE;
 		goto out;
 	}
-	if ((error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp)) != 0) {
-		mp = NULL;
-		goto out;
-	}
-	(void) vn_start_write(vp, &mp, V_WAIT);
-	vput(vp);
-	vp = NULL;
+	(void) vn_start_write(NULL, &mp, V_WAIT);
 	nfsm_srvnamesiz(len);
 	nd.ni_cnd.cn_cred = cred;
 	nd.ni_cnd.cn_nameiop = DELETE;
_at__at_ -3697,13 +3633,7 _at__at_
 		error = ESTALE;
 		goto ereply;
 	}
-	if ((error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp)) != 0) {
-		mp = NULL;
-		goto ereply;
-	}
-	(void) vn_start_write(vp, &mp, V_WAIT);
-	vput(vp);
-	vp = NULL;
+	(void) vn_start_write(NULL, &mp, V_WAIT);
 	tl = nfsm_dissect(u_int32_t *, 3 * NFSX_UNSIGNED);
 
 	/*
-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk_at_FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.
Received on Fri Oct 24 2003 - 02:30:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:26 UTC