From: "J. Bruce Fields" <bfields@fieldses.org>
To: Dai Ngo <dai.ngo@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] nfs4lib.py: enhance open_file to work with courteous server
Date: Wed, 15 Jun 2022 15:34:53 -0400 [thread overview]
Message-ID: <20220615193453.GB16220@fieldses.org> (raw)
In-Reply-To: <1655314495-17735-1-git-send-email-dai.ngo@oracle.com>
THere are tests that want to explicitly test for DELAY returns. (Grep
for ERR_DELAY. Look at the delegation tests especially.) Does this
work for them? I assumed we'd want an optional parameter that allowed
to caller to circument the DELAY handling.
--b.
On Wed, Jun 15, 2022 at 10:34:54AM -0700, Dai Ngo wrote:
> 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@oracle.com>
> ---
> 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
next prev parent reply other threads:[~2022-06-15 19:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 17:34 [PATCH 1/2] nfs4lib.py: enhance open_file to work with courteous server Dai Ngo
2022-06-15 17:34 ` [PATCH 2/2] environment.py: enhance open_create_file " Dai Ngo
2022-06-15 19:34 ` J. Bruce Fields [this message]
2022-06-15 19:48 ` [PATCH 1/2] nfs4lib.py: enhance open_file " dai.ngo
2022-07-11 18:05 ` J. Bruce Fields
2022-07-11 18:16 ` dai.ngo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220615193453.GB16220@fieldses.org \
--to=bfields@fieldses.org \
--cc=dai.ngo@oracle.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.