Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 May 2025 19:39:12 GMT
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e647a222a1a7 - main - nfs_clrpcops.c: Fix handling of a CreateLayGet reply
Message-ID:  <202505161939.54GJdCnX041056@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by rmacklem:

URL: https://cgit.FreeBSD.org/src/commit/?id=e647a222a1a74bd3b2bbdd7903fb30e4e30b6b09

commit e647a222a1a74bd3b2bbdd7903fb30e4e30b6b09
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2025-05-16 19:36:39 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2025-05-16 19:36:39 +0000

    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
---
 sys/fs/nfsclient/nfs_clrpcops.c | 7 +++++++
 1 file changed, 7 insertions(+)

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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505161939.54GJdCnX041056>