Author: jhb
Date: Thu Feb 28 19:01:04 2013
New Revision: 247492
URL: http://svnweb.freebsd.org/changeset/base/247492

Log:
  MFC 245476:
  - 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.

Modified:
  stable/8/sys/fs/nfs/nfs_commonkrpc.c
  stable/8/sys/nfsclient/nfs_krpc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/fs/   (props changed)
  stable/8/sys/nfsclient/   (props changed)

Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- stable/8/sys/fs/nfs/nfs_commonkrpc.c        Thu Feb 28 19:00:57 2013        
(r247491)
+++ stable/8/sys/fs/nfs/nfs_commonkrpc.c        Thu Feb 28 19:01:04 2013        
(r247492)
@@ -695,12 +695,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: stable/8/sys/nfsclient/nfs_krpc.c
==============================================================================
--- stable/8/sys/nfsclient/nfs_krpc.c   Thu Feb 28 19:00:57 2013        
(r247491)
+++ stable/8/sys/nfsclient/nfs_krpc.c   Thu Feb 28 19:01:04 2013        
(r247492)
@@ -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);
        }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to