git: 425e5c739bcf - main - nfscl: Do not handle NFSERR_BADSESSION in operation code
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 27 May 2022 21:21:36 UTC
The branch main has been updated by rmacklem:
URL: https://cgit.FreeBSD.org/src/commit/?id=425e5c739bcf190265330b79e85f89eb4d7b5f25
commit 425e5c739bcf190265330b79e85f89eb4d7b5f25
Author: Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2022-05-27 21:20:31 +0000
Commit: Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2022-05-27 21:20:31 +0000
nfscl: Do not handle NFSERR_BADSESSION in operation code
The NFSERR_BADSESSION reply from a NFSv4.1/4.2 server
is handled by newnfs_request(). It should not be handled
separately after newnfs_request() has returned.
These two cases were spotted during code inspection.
One of them should only redo what newnfs_request() already
did by the same "nfscl" thread. The other might have
resulted in recovery being done twice, but the code is
only used for "pnfs" mounts, so that would be rare.
Also, since NFSERR_BADSESSION should only be replied by
a server after the server reboots, this would be extremely
rare.
MFC after: 2 weeks
---
sys/fs/nfsclient/nfs_clrpcops.c | 2 +-
sys/fs/nfsclient/nfs_clstate.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index 83ce96107ecc..b1d3ee423194 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -8355,7 +8355,7 @@ nfsrpc_createlayout(vnode_t dvp, char *name, int namelen, struct vattr *vap,
}
if (nd->nd_repstat != 0 && error == 0)
error = nd->nd_repstat;
- if (error == NFSERR_STALECLIENTID || error == NFSERR_BADSESSION)
+ if (error == NFSERR_STALECLIENTID)
nfscl_initiate_recovery(owp->nfsow_clp);
nfsmout:
NFSCL_DEBUG(4, "eo nfsrpc_createlayout err=%d\n", error);
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index 7ee98aa901d8..3b65828d5958 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -2765,8 +2765,7 @@ nfscl_renewthread(struct nfsclclient *clp, NFSPROC_T *p)
error = nfsrpc_renew(clp, NULL, cred, p);
if (error == NFSERR_CBPATHDOWN)
cbpathdown = 1;
- else if (error == NFSERR_STALECLIENTID ||
- error == NFSERR_BADSESSION) {
+ else if (error == NFSERR_STALECLIENTID) {
NFSLOCKCLSTATE();
clp->nfsc_flags |= NFSCLFLAGS_RECOVER;
NFSUNLOCKCLSTATE();