Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jan 2013 22:08:17 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r245476 - in head/sys: fs/nfs nfsclient
Message-ID:  <201301152208.r0FM8HJZ059746@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Jan 15 22:08:17 2013
New Revision: 245476
URL: http://svnweb.freebsd.org/changeset/base/245476

Log:
  - More properly handle interrupted NFS requests on an interruptible mount
    by returning an error of EINTR rather than EACCES.
  - While here, bring back some (but not all) of the NFS RPC statistics lost
    when krpc was committed.
  
  Reviewed by:	rmacklem
  MFC after:	1 week

Modified:
  head/sys/fs/nfs/nfs_commonkrpc.c
  head/sys/nfsclient/nfs_krpc.c

Modified: head/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- head/sys/fs/nfs/nfs_commonkrpc.c	Tue Jan 15 22:08:03 2013	(r245475)
+++ head/sys/fs/nfs/nfs_commonkrpc.c	Tue Jan 15 22:08:17 2013	(r245476)
@@ -767,12 +767,18 @@ tryagain:
 	if (stat == RPC_SUCCESS) {
 		error = 0;
 	} else if (stat == RPC_TIMEDOUT) {
+		NFSINCRGLOBAL(newnfsstats.rpctimeouts);
 		error = ETIMEDOUT;
 	} else if (stat == RPC_VERSMISMATCH) {
+		NFSINCRGLOBAL(newnfsstats.rpcinvalid);
 		error = EOPNOTSUPP;
 	} else if (stat == RPC_PROGVERSMISMATCH) {
+		NFSINCRGLOBAL(newnfsstats.rpcinvalid);
 		error = EPROTONOSUPPORT;
+	} else if (stat == RPC_INTR) {
+		error = EINTR;
 	} else {
+		NFSINCRGLOBAL(newnfsstats.rpcinvalid);
 		error = EACCES;
 	}
 	if (error) {

Modified: head/sys/nfsclient/nfs_krpc.c
==============================================================================
--- head/sys/nfsclient/nfs_krpc.c	Tue Jan 15 22:08:03 2013	(r245475)
+++ head/sys/nfsclient/nfs_krpc.c	Tue Jan 15 22:08:17 2013	(r245476)
@@ -549,14 +549,21 @@ tryagain:
 	 */
 	if (stat == RPC_SUCCESS)
 		error = 0;
-	else if (stat == RPC_TIMEDOUT)
+	else if (stat == RPC_TIMEDOUT) {
+		nfsstats.rpctimeouts++;
 		error = ETIMEDOUT;
-	else if (stat == RPC_VERSMISMATCH)
+	} else if (stat == RPC_VERSMISMATCH) {
+		nfsstats.rpcinvalid++;
 		error = EOPNOTSUPP;
-	else if (stat == RPC_PROGVERSMISMATCH)
+	} else if (stat == RPC_PROGVERSMISMATCH) {
+		nfsstats.rpcinvalid++;
 		error = EPROTONOSUPPORT;
-	else
+	} else if (stat == RPC_INTR) {
+		error = EINTR;
+	} else {
+		nfsstats.rpcinvalid++;
 		error = EACCES;
+	}
 	if (error)
 		goto nfsmout;
 
@@ -572,6 +579,7 @@ tryagain:
 	if (error == ENOMEM) {
 		m_freem(mrep);
 		AUTH_DESTROY(auth);
+		nfsstats.rpcinvalid++;
 		return (error);
 	}
 



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