aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2023-12-03 23:31:01 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2023-12-17 21:13:01 +0000
commitdd6bdfcd073ee8461c7d5a7a8fe336831a57b685 (patch)
tree78d6708d38c41a34b1baceb4700b8ff91df7cdff
parent890afd892c13d3ab13622a6b9c17ea7236217cf3 (diff)
downloadsrc-dd6bdfcd073ee8461c7d5a7a8fe336831a57b685.tar.gz
src-dd6bdfcd073ee8461c7d5a7a8fe336831a57b685.zip
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. (cherry picked from commit 6aded1e6b2e5549120031032e1c7f8b002882327)
-rw-r--r--sys/fs/nfsclient/nfs_clrpcops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index 53e3ab9b03ea..0a9c54ce5e1e 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -2550,7 +2550,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