[PATCH 1/2] nfs4lib.py: enhance open_file to work with courteous server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Enhance open_file to handle NFS4ERR_DELAY returned by the server
in case of share/access/delegation conflict.

Signed-off-by: Dai Ngo <dai.ngo@xxxxxxxxxx>
---
 nfs4.0/nfs4lib.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/nfs4.0/nfs4lib.py b/nfs4.0/nfs4lib.py
index 934def3b7333..e0299e8d6676 100644
--- a/nfs4.0/nfs4lib.py
+++ b/nfs4.0/nfs4lib.py
@@ -677,7 +677,12 @@ class NFS4Client(rpc.RPCClient):
                           claim_type=claim_type, deleg_type=deleg_type,
                           deleg_cur_info=deleg_cur_info)]
         ops += [op4.getfh()]
-        res = self.compound(ops)
+        while 1:
+            res = self.compound(ops)
+            if res.status == NFS4ERR_DELAY:
+                time.sleep(2)
+            else:
+                break
         self.advance_seqid(owner, res)
         if set_recall and (res.status != NFS4_OK or \
            res.resarray[-2].switch.switch.delegation == OPEN_DELEGATE_NONE):
-- 
2.27.0




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux