aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2025-05-16 19:36:39 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2025-05-16 19:36:39 +0000
commite647a222a1a74bd3b2bbdd7903fb30e4e30b6b09 (patch)
tree43e165031f3d1a4e0c5b1e79b18d3f803fb816a7
parent4dbe268d2e7ad4f1172a174a3c55f0fdff3aaa99 (diff)
nfs_clrpcops.c: Fix handling of a CreateLayGet reply
Without this patch, the CreateLayGet RPC did not handle a NFSv4.1/4.2 reply for a pNFS server that also issued delegations. This patch fixes the problem. Detected at the recent NFSv4 Bakeathon testing event. This bug would only affect the rare case where the FreeBSD client is mounted to a pNFS server that issues delegations, where the "pnfs" mount option is specified. MFC after: 2 weeks
-rw-r--r--sys/fs/nfsclient/nfs_clrpcops.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index c1f94a65e506..4ff56f75123c 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -8590,6 +8590,13 @@ nfsrpc_createlayout(vnode_t dvp, char *name, int namelen, struct vattr *vap,
&ret, &acesize, p);
if (error != 0)
goto nfsmout;
+ } else if (deleg == NFSV4OPEN_DELEGATENONEEXT &&
+ NFSHASNFSV4N(nmp)) {
+ NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED);
+ deleg = fxdr_unsigned(uint32_t, *tl);
+ if (deleg == NFSV4OPEN_CONTENTION ||
+ deleg == NFSV4OPEN_RESOURCE)
+ NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED);
} else if (deleg != NFSV4OPEN_DELEGATENONE) {
error = NFSERR_BADXDR;
goto nfsmout;