From patchwork Wed Jun 15 17:34:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dai Ngo X-Patchwork-Id: 12882815 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26294C43334 for ; Wed, 15 Jun 2022 17:35:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355870AbiFORfD (ORCPT ); Wed, 15 Jun 2022 13:35:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345533AbiFORfC (ORCPT ); Wed, 15 Jun 2022 13:35:02 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D09D7FD09 for ; Wed, 15 Jun 2022 10:35:01 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25FHXogL022330; Wed, 15 Jun 2022 17:35:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2021-07-09; bh=BkGNZU0Eu6DMGIcYenZPJ9O2Bzfs6eojE/2XJ5bkCvo=; b=nlakMsN3btbbZMcnS2sO9504xKX9zePT6o+gT50h/COVoBpfQhDQ9p5474e7ruY65Zx4 tax0X6zNEmVrWmRZFnWPfaTwwKy1qx8pWJ01oDg+LX27PMahtkRN19dagiwVwwSSU6rx GbdhrldtAkPy40KYGy1U6igL/Timg0f6iGzm5XCbU8HVvD5Ori+d/edFBTUC/RStIDJo uf9UtI41ChHkUsCWI+EqaVC3lPhJgXd9ItmXqOGO5jHc4LEOOnFWGrKwqbBbB8ubhaXf grUtd12rW/rN8g4EUPoGkm7wrOxDo/AM/71C3DOVxIp5KJjkwqDcnUQ66QIZ/+pvISjP eA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gmhfcs5vf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Jun 2022 17:35:00 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25FHFxfs013720; Wed, 15 Jun 2022 17:34:59 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gpr261pc0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Jun 2022 17:34:59 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 25FHRi3s001726; Wed, 15 Jun 2022 17:34:59 GMT Received: from ca-common-hq.us.oracle.com (ca-common-hq.us.oracle.com [10.211.9.209]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gpr261pbh-1; Wed, 15 Jun 2022 17:34:58 +0000 From: Dai Ngo To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH 1/2] nfs4lib.py: enhance open_file to work with courteous server Date: Wed, 15 Jun 2022 10:34:54 -0700 Message-Id: <1655314495-17735-1-git-send-email-dai.ngo@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-ORIG-GUID: l5BCs8l--J-KEHKvNl6wWts7n9tShG4G X-Proofpoint-GUID: l5BCs8l--J-KEHKvNl6wWts7n9tShG4G Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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): From patchwork Wed Jun 15 17:34:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dai Ngo X-Patchwork-Id: 12882816 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DB51C433EF for ; Wed, 15 Jun 2022 17:35:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345533AbiFORfE (ORCPT ); Wed, 15 Jun 2022 13:35:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347502AbiFORfD (ORCPT ); Wed, 15 Jun 2022 13:35:03 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B19FF11837 for ; Wed, 15 Jun 2022 10:35:02 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25FHXrPk032726; Wed, 15 Jun 2022 17:35:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2021-07-09; bh=oj864GkOr/s35FlpHkEPCyGXZqt8gDAWU4uzb2H5cA8=; b=wLcs5QOEbaAJEe+AGShm4uRcnv6dwRYMH5wJRT4VO4EkCoGzKXxCxUqs8w56tyzMJEHY nQnPUscnJOoNP3JDK0k+1cydrGzMfcWKpo7Squ+TLcsgFwuA/EQXzdPQztAgSQOvabub wiliDCwF7xGhFWn4hiryplUjYA41DQ7c3ut/0OEiTC5MA93CHJx6CVcM87vlHCqqzynX v0CK0prcI6Zd1df3mmKG+g+SdC6YMfHakzuVi5tU+ebTsENGNQqSHS52ycAJV93GrEtl unA5sAkpyEZeqCrvVCIRernP5LUcqRcWH5P54faoNhET5ivNqLcTjj33xXCsA3aVBvlu +g== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3gmhu2sb2n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Jun 2022 17:35:00 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 25FHFxvk013638; Wed, 15 Jun 2022 17:34:59 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gpr261pc8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Jun 2022 17:34:59 +0000 Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 25FHRi3u001726; Wed, 15 Jun 2022 17:34:59 GMT Received: from ca-common-hq.us.oracle.com (ca-common-hq.us.oracle.com [10.211.9.209]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3gpr261pbh-2; Wed, 15 Jun 2022 17:34:59 +0000 From: Dai Ngo To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH 2/2] environment.py: enhance open_create_file to work with courteous server Date: Wed, 15 Jun 2022 10:34:55 -0700 Message-Id: <1655314495-17735-2-git-send-email-dai.ngo@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1655314495-17735-1-git-send-email-dai.ngo@oracle.com> References: <1655314495-17735-1-git-send-email-dai.ngo@oracle.com> X-Proofpoint-GUID: 0NCwkKaIkcQjdvIdGCixi2mi8fooQNvV X-Proofpoint-ORIG-GUID: 0NCwkKaIkcQjdvIdGCixi2mi8fooQNvV Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Enhance open_create_file to handle NFS4ERR_DELAY returned by the server in case of share/access/delegation conflict. Signed-off-by: Dai Ngo --- nfs4.1/server41tests/environment.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py index 0b7c976d8582..fb834b28841b 100644 --- a/nfs4.1/server41tests/environment.py +++ b/nfs4.1/server41tests/environment.py @@ -483,11 +483,16 @@ def open_create_file(sess, owner, path=None, attrs={FATTR4_MODE: 0o644}, deleg_type=None, open_create=OPEN4_NOCREATE, seqid=0, clientid=0): - open_op = open_create_file_op(sess, owner, path, attrs, access, deny, mode, - verifier, claim_type, want_deleg, deleg_type, - open_create, seqid, clientid) - - return sess.compound(open_op) + while 1: + open_op = open_create_file_op(sess, owner, path, attrs, access, deny, mode, + verifier, claim_type, want_deleg, deleg_type, + open_create, seqid, clientid) + res = sess.compound(open_op) + if res.status == NFS4ERR_DELAY: + time.sleep(2) + else: + break + return res def open_create_file_op(sess, owner, path=None, attrs={FATTR4_MODE: 0o644}, access=OPEN4_SHARE_ACCESS_BOTH,