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
This commit is contained in:
Rick Macklem
2025-05-16 12:36:39 -07:00
parent 4dbe268d2e
commit e647a222a1
+7
View File
@@ -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;