aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2023-04-07 19:57:26 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2023-04-07 19:57:26 +0000
commit4adb28c0abfa3b8d076c7249f61a093c6eb9dac2 (patch)
tree18dc3527eba25d0b8448cb3132b79afe3e9a920c
parentff2f1f691cdb376be70b9579d2f9c91b06ac839d (diff)
downloadsrc-4adb28c0abfa3b8d076c7249f61a093c6eb9dac2.tar.gz
src-4adb28c0abfa3b8d076c7249f61a093c6eb9dac2.zip
nfscl: Fix support for doing Null RPCs
Although the NFS client does not currently perform Null RPCs, this fix is needed if/when it might do so. Found during testing of experimental code that uses Null RPCs to maintain/monitor TCP connections for "nconnect" mounts. MFC after: 3 months
-rw-r--r--sys/fs/nfs/nfs_commonsubs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c
index 81bd2beba749..cb12f5a59a6e 100644
--- a/sys/fs/nfs/nfs_commonsubs.c
+++ b/sys/fs/nfs/nfs_commonsubs.c
@@ -375,6 +375,10 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp,
nd->nd_mreq = nd->nd_mb = mb;
nd->nd_bpos = mtod(mb, char *);
+ /* For NFSPROC_NULL, there are no arguments. */
+ if (procnum == NFSPROC_NULL)
+ goto out;
+
/*
* And fill the first file handle into the request.
*/
@@ -470,6 +474,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp,
} else {
(void)nfsm_fhtom(NULL, nd, nfhp, fhlen, 0);
}
+out:
if (procnum < NFSV42_NPROCS)
NFSINCRGLOBAL(nfsstatsv1.rpccnt[procnum]);
}