Subject: Re: nfs servers and 5 minute VOP_READ's
To: Roger Brooks <R.S.Brooks@liverpool.ac.uk>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: tech-kern
Date: 03/16/1999 12:48:58
Oops!

The way I included the patches confused pine when it received the message.
It showed them (to me at least) as a seperate message to
wrstuden@sally.nas.nasa.gov. Sorry.

Let me try again to keep the thread coherent.


--- /sys/nfs/nfs_serv.c	Tue Feb 16 17:24:56 1999
+++ nfs_serv.c	Tue Mar 16 10:47:37 1999
@@ -702,7 +702,13 @@
 		uiop->uio_resid = cnt;
 		uiop->uio_rw = UIO_READ;
 		uiop->uio_segflg = UIO_SYSSPACE;
-		error = VOP_READ(vp, uiop, IO_NODELOCKED, cred);
+		if (v3) {
+			error = VOP_READ(vp, uiop,
+					IO_NODELOCKED | IO_NDELAY, cred);
+			if (error == EAGAIN)
+				error = NFSERR_TRYLATER;
+		} else
+			error = VOP_READ(vp, uiop, IO_NODELOCKED, cred);
 		off = uiop->uio_offset;
 		FREE((caddr_t)iv2, M_TEMP);
 		if (error || (getret = VOP_GETATTR(vp, &va, cred, procp)) != 0){
@@ -883,7 +889,12 @@
 	    uiop->uio_segflg = UIO_SYSSPACE;
 	    uiop->uio_procp = (struct proc *)0;
 	    uiop->uio_offset = off;
-	    error = VOP_WRITE(vp, uiop, ioflags, cred);
+	    if (v3) {
+	    	error = VOP_WRITE(vp, uiop, ioflags | IO_NDELAY, cred);
+		if (error == EAGAIN)
+			error = NFSERR_TRYLATER;
+	    } else
+	    	error = VOP_WRITE(vp, uiop, ioflags, cred);
 	    nfsstats.srvvop_writes++;
 	    FREE((caddr_t)iv, M_TEMP);
 	}


Take care,

Bill