* [PATCH pynfs] Actually reuse the slot only when the sequence op gets an NFS4ERR_DELAY status. Before this patch, any NFS4ERR_DELAY would consume a new slot even when the sequence op was not the culprit.
@ 2025-04-10 21:17 bryan
0 siblings, 0 replies; only message in thread
From: bryan @ 2025-04-10 21:17 UTC (permalink / raw)
To: calum.mackay; +Cc: linux-nfs, Bryan Schmersal
From: Bryan Schmersal <bryan@schmersal.org>
Signed-off-by: Bryan Schmersal <bryan@schmersal.org>
---
nfs4.1/nfs4client.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/nfs4.1/nfs4client.py b/nfs4.1/nfs4client.py
index f4fabcc..a180872 100644
--- a/nfs4.1/nfs4client.py
+++ b/nfs4.1/nfs4client.py
@@ -539,17 +539,21 @@ class SessionRecord(object):
delay_time = 1
handle_state_errors = kwargs.pop("handle_state_errors", True)
saved_kwargs = kwargs
- slot, seq_op = self._prepare_compound(kwargs)
+ do_prepare = True
for item in range(max_retries):
+ if do_prepare:
+ slot, seq_op = self._prepare_compound(saved_kwargs)
res = self.c.compound([seq_op] + ops, **kwargs)
res = self.update_seq_state(res, slot)
if res.status != NFS4ERR_DELAY or not handle_state_errors:
break
- if res.resarray[0].sr_status != NFS4ERR_DELAY:
+ if res.resarray[0].sr_status == NFS4ERR_DELAY:
# As per errata ID 2006 for RFC 5661 section 15.1.1.3
# don't update the slot and sequence ID if the sequence
# operation itself receives NFS4ERR_DELAY
- slot, seq_op = self._prepare_compound(saved_kwargs)
+ do_prepare = False
+ else:
+ do_prepare = True
time.sleep(delay_time)
res = self.remove_seq_op(res)
return res
--
2.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-10 21:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-10 21:17 [PATCH pynfs] Actually reuse the slot only when the sequence op gets an NFS4ERR_DELAY status. Before this patch, any NFS4ERR_DELAY would consume a new slot even when the sequence op was not the culprit bryan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox