- 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
This commit is contained in:
parent
58fdb5f3e6
commit
6910d7a0d8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245476
@ -767,12 +767,18 @@ newnfs_request(struct nfsrv_descript *nd, struct nfsmount *nmp,
|
|||||||
if (stat == RPC_SUCCESS) {
|
if (stat == RPC_SUCCESS) {
|
||||||
error = 0;
|
error = 0;
|
||||||
} else if (stat == RPC_TIMEDOUT) {
|
} else if (stat == RPC_TIMEDOUT) {
|
||||||
|
NFSINCRGLOBAL(newnfsstats.rpctimeouts);
|
||||||
error = ETIMEDOUT;
|
error = ETIMEDOUT;
|
||||||
} else if (stat == RPC_VERSMISMATCH) {
|
} else if (stat == RPC_VERSMISMATCH) {
|
||||||
|
NFSINCRGLOBAL(newnfsstats.rpcinvalid);
|
||||||
error = EOPNOTSUPP;
|
error = EOPNOTSUPP;
|
||||||
} else if (stat == RPC_PROGVERSMISMATCH) {
|
} else if (stat == RPC_PROGVERSMISMATCH) {
|
||||||
|
NFSINCRGLOBAL(newnfsstats.rpcinvalid);
|
||||||
error = EPROTONOSUPPORT;
|
error = EPROTONOSUPPORT;
|
||||||
|
} else if (stat == RPC_INTR) {
|
||||||
|
error = EINTR;
|
||||||
} else {
|
} else {
|
||||||
|
NFSINCRGLOBAL(newnfsstats.rpcinvalid);
|
||||||
error = EACCES;
|
error = EACCES;
|
||||||
}
|
}
|
||||||
if (error) {
|
if (error) {
|
||||||
|
@ -549,14 +549,21 @@ nfs_request(struct vnode *vp, struct mbuf *mreq, int procnum,
|
|||||||
*/
|
*/
|
||||||
if (stat == RPC_SUCCESS)
|
if (stat == RPC_SUCCESS)
|
||||||
error = 0;
|
error = 0;
|
||||||
else if (stat == RPC_TIMEDOUT)
|
else if (stat == RPC_TIMEDOUT) {
|
||||||
|
nfsstats.rpctimeouts++;
|
||||||
error = ETIMEDOUT;
|
error = ETIMEDOUT;
|
||||||
else if (stat == RPC_VERSMISMATCH)
|
} else if (stat == RPC_VERSMISMATCH) {
|
||||||
|
nfsstats.rpcinvalid++;
|
||||||
error = EOPNOTSUPP;
|
error = EOPNOTSUPP;
|
||||||
else if (stat == RPC_PROGVERSMISMATCH)
|
} else if (stat == RPC_PROGVERSMISMATCH) {
|
||||||
|
nfsstats.rpcinvalid++;
|
||||||
error = EPROTONOSUPPORT;
|
error = EPROTONOSUPPORT;
|
||||||
else
|
} else if (stat == RPC_INTR) {
|
||||||
|
error = EINTR;
|
||||||
|
} else {
|
||||||
|
nfsstats.rpcinvalid++;
|
||||||
error = EACCES;
|
error = EACCES;
|
||||||
|
}
|
||||||
if (error)
|
if (error)
|
||||||
goto nfsmout;
|
goto nfsmout;
|
||||||
|
|
||||||
@ -572,6 +579,7 @@ nfs_request(struct vnode *vp, struct mbuf *mreq, int procnum,
|
|||||||
if (error == ENOMEM) {
|
if (error == ENOMEM) {
|
||||||
m_freem(mrep);
|
m_freem(mrep);
|
||||||
AUTH_DESTROY(auth);
|
AUTH_DESTROY(auth);
|
||||||
|
nfsstats.rpcinvalid++;
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user