Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3583883imw; Mon, 11 Jul 2022 11:23:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uQkYz5wJcfUfuRSZSYRKCAAWWebAXOLIIPQnLvTotNGjUhsIh4SWKwqol3A6f0Rzdzg/NQ X-Received: by 2002:a05:6402:42c8:b0:43a:a1ee:a097 with SMTP id i8-20020a05640242c800b0043aa1eea097mr26287415edc.150.1657563827136; Mon, 11 Jul 2022 11:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657563827; cv=none; d=google.com; s=arc-20160816; b=DHe9z8yKfjQ8MWdIY8cG5LSJgpVxzqAURgqciIixfyLYfKvbrPRBBNiawJ6Zq8SXpK +aVsQpyZbevI6D5WN69t9rQu0ef9dXjN9oBF8yA+nDkh66NoUVjVDg/veibclLRL5TJF AyCBR5jesHxz3WO5z9Pjsr9KQ12m23NZPftaImzWoo5TkKtqE9ekmtdB8tEuegB9rEYD bmh+IZrMfdJnNniNg/c/1LSPyYuRVFP4OjvcYvc8Rl3A34Ld12NCeI45bDnpsNd33pN2 I9ofAJ8mTt5b5VWBgh4xn7+pA140TgOB/ZKGJHziZYt2k/0agbxHkO4upTL/kb5Fzvgx pTqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=npTDQANjZu2Li+K4WkeB01OhkHJunDwIw5tvbghsje4=; b=Kn3XQL78Ept4By+GFKH54VbRf1Flhn8V/xlsj+iMlEVOYNByiDDMANe99RvkpEF0GK AzgnkDpoBc2cgXB60cN1MGPy0ADM74QQaCko4wQ1q1k+AoHY6RHeLWUp/viqJjWkEbsg SUhXoj3SZbzftdpGAMlTAMD4rG5t3EeJVeWWEezKo+wzI9gEPMU9Zhtn1ekdKCLEDTTl tdMDjJ5NUtSOsEzmiMQRgN07ghuA2dgTvnDb+HygcloRB/k5k1jiaWqs1YtesWmZ8pCN VGtJCNkqjIa0a6cN/Kssx08DpOeubexcEcOhbbSyr7bZk3DxtrmSO/0g95atRJE7Teo1 9o1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=sON7tt+q; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fieldses.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw9-20020a170906478900b00711fd60fa17si12172940ejc.34.2022.07.11.11.23.19; Mon, 11 Jul 2022 11:23:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=sON7tt+q; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fieldses.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbiGKSF2 (ORCPT + 99 others); Mon, 11 Jul 2022 14:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229771AbiGKSF1 (ORCPT ); Mon, 11 Jul 2022 14:05:27 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D21AE220F8 for ; Mon, 11 Jul 2022 11:05:22 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 3AB2C64A6; Mon, 11 Jul 2022 14:05:22 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 3AB2C64A6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1657562722; bh=npTDQANjZu2Li+K4WkeB01OhkHJunDwIw5tvbghsje4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sON7tt+qkX9BxptIrGUMrFhwLpH1yI9GBuSNOmfatlduU9eDe41i/sL/J8FRfe6np leKjSOHfpeVYIZYEfHoihqfCXyoS9xS5mHEBuSkLzkTEMJ88lX3GsGTYzs5Aa1jTfi foEqItcxUBzJnTYajB3wM5gmuaNv9gp7OxN3Kgsk= Date: Mon, 11 Jul 2022 14:05:22 -0400 From: "J. Bruce Fields" To: 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 Message-ID: <20220711180522.GA14184@fieldses.org> References: <1655314495-17735-1-git-send-email-dai.ngo@oracle.com> <20220615193453.GB16220@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Applying, thanks, sorry for the delay.--b. On Wed, Jun 15, 2022 at 12:48:17PM -0700, dai.ngo@oracle.com wrote: > > On 6/15/22 12:34 PM, J. Bruce Fields wrote: > >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? > > Those tests expect NFS4_OK but also handle NFS4ERR_DELAY themselves > if the OPEN causes recall. With this patch, the NFS4ERR_DELAY is handled > internally by open_file so the ERR_DELAY never get to those tests. > All tests passed with this patch. > > -Dai > > > 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 > >>--- > >> 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