git: 6aded1e6b2e5 - main - nfscl: Fix processing of a rare Rename reply case

From: Rick Macklem <rmacklem_at_FreeBSD.org>
Date: Sun, 03 Dec 2023 23:33:00 UTC
The branch main has been updated by rmacklem:

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

commit 6aded1e6b2e5549120031032e1c7f8b002882327
Author:     Rick Macklem <rmacklem@FreeBSD.org>
AuthorDate: 2023-12-03 23:31:01 +0000
Commit:     Rick Macklem <rmacklem@FreeBSD.org>
CommitDate: 2023-12-03 23:31:01 +0000

    nfscl: Fix processing of a rare Rename reply case
    
    When delegations are enabled (they are not by default in
    the FreeBSD NFSv4 server), rename will check for and return
    delegations.  If the second of these DelegReturn operations
    were to fail (they rarely do), then the code would not retry
    the rename with returning delegations, as it is intended to do.
    
    The patch fixes the problem, since the DelegReturn reply status
    is the second iteration of the loop and not the first iteration.
    
    As noted, this bug would have rarely manifested a problem, since
    DelegReturn operations do not normally fail.
    
    MFC after:      2 weeks
---
 sys/fs/nfsclient/nfs_clrpcops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index 1b0011760d10..81871dc885cd 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -3001,7 +3001,7 @@ tryagain:
 			    ND_NFSV4) {
 			    NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
 			    if (*(tl + 1)) {
-				if (i == 0 && ret > 1) {
+				if (i == 1 && ret > 1) {
 				    /*
 				     * If the Delegreturn failed, try again
 				     * without it. The server will Recall, as