Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 May 2025 20:36:37 GMT
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 6f9b2071b843 - stable/14 - nfs_clrpcops.c: Fix handling of a CreateLayGet reply
Message-ID:  <202505302036.54UKabQB004506@gitrepo.freebsd.org>

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

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

commit 6f9b2071b8435ed366310a16cf0cb8f2e2797ae5
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2025-05-16 19:36:39 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2025-05-30 20:34:07 +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.
    
    (cherry picked from commit e647a222a1a74bd3b2bbdd7903fb30e4e30b6b09)
---
 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 d37bffc5ad2e..5722810191b4 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -8584,6 +8584,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?202505302036.54UKabQB004506>