From patchwork Wed Mar 24 01:46:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calum Mackay X-Patchwork-Id: 12160041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 876CFC433C1 for ; Wed, 24 Mar 2021 01:47:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47212619E8 for ; Wed, 24 Mar 2021 01:47:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231777AbhCXBrW (ORCPT ); Tue, 23 Mar 2021 21:47:22 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:54846 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231838AbhCXBq5 (ORCPT ); Tue, 23 Mar 2021 21:46:57 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12O1eu9U033268; Wed, 24 Mar 2021 01:46:54 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 : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=3mly1dW/RmLJdsdhV4q9tyNU1U3Q0u+Fx6bVImQD2ak=; b=rcl3kHjPrwCHIx0vjprPzGQkuBi/26irbwdf0n5DHsZ2NwWpB2e7DFfKHeLgTF4T5wVL ZTL3ypy/tHJPBnCFUgjbfal5+q+zs9hCIOl1xXbs46sVA1f73fvy83E7pUU6vwd+mQD3 0okuQG8JuQXdKeUjGl1eWt3AgKAoz5T491ep1qQ7/zBwfmjyiGzgDNofVQInTYm9ZPDH yHgvgtxZwSB5a+HFAdlkbxOQaewNiiTdkLeNY7TIh6VZ2LL5vv17fOXh4hfanCgbU8GX IF1WI2PlwrB6S094Rwd56QI9gHNkotJfVb078YpKsO6LNyzGaSnIQtK8PL0zJbnpBeQu VA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 37d9pn13yf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Mar 2021 01:46:54 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12O1il3c093711; Wed, 24 Mar 2021 01:46:54 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2055.outbound.protection.outlook.com [104.47.36.55]) by userp3030.oracle.com with ESMTP id 37dtyy7mxr-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Mar 2021 01:46:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GQSKsYNDv733fzs8AEDJo1IM8xiRFNQOd9EHyqJNePFAGIn+4CE0FxL6j0gYCQp3zvw8B4bi9t9aDIydBko7ghGne3m8geF4znW/5Uix9/MYNCX9/o20E9IEhoJ5LcZauAIB2lS9SqMrBhCpPTmuCa2Fvgp/0HyBJUj0RfcHXi6m+FK/34Sjr+huVZgsyddHn4rZDhV7oMoIZJZ4FsVFTFCWqSJNEcZHbXb/GQCSmkQ3Ug5xlxyfAV2BCzh1mFDfYkhukkUQGSzbv0LQYLS/Rd8We2ZRF18baIWwphWYCcWpAYCcvA/zyaX3c2ZiZsKfDox3cUK5O09wXhYaDnX44g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3mly1dW/RmLJdsdhV4q9tyNU1U3Q0u+Fx6bVImQD2ak=; b=IFl+iP/ms/k1KmV1Xzn4nUGO4EpjRG7gkQvH51uHWSa2WPTtI9gw7tSV2K638DXe+VKKxzlqQTqoFiZPZ0MWoIHq/C02S4gvDc2AsWy6w/g7Jwq7CppHtE4NA3EoYK1GVBaH6SLfw3N/RKiuEEmpfGKfVcXDuR0xMUo+rN6RFvXD6i+ptLZm26bYQNDGysrh76NNUBlBeHtEge4izyo+hPw3CjgMai8nnHtMeZDt4rKO6ArfLf/UPECMxqIJid0BN7FIbtUiqElU/nqSV4sxN5riE/t5v7h8Kz4fyboUCYTaXS7A2MYpPx/dkvRj84OF74DJkoUI0geY1qPEn7E97w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3mly1dW/RmLJdsdhV4q9tyNU1U3Q0u+Fx6bVImQD2ak=; b=VVIZYpLEtavDfyxjPlvb/Nv7yO0O3feZ8S3GIpj1GsJIpImo/pDqQf+TF3GM6zcc+zROfaC8FW/mCzPdNCFTKzqWo/BZhQve5irG9HSNadG5SGVdQiVuwKlR6rW7jWue3KVk/6OcxPp7WWywC2Di0gH1kNrA04zz5WI4fJqosl4= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=oracle.com; Received: from CY4PR1001MB2119.namprd10.prod.outlook.com (2603:10b6:910:3f::15) by CY4PR10MB1304.namprd10.prod.outlook.com (2603:10b6:903:26::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24; Wed, 24 Mar 2021 01:46:53 +0000 Received: from CY4PR1001MB2119.namprd10.prod.outlook.com ([fe80::848c:1057:dabd:55b2]) by CY4PR1001MB2119.namprd10.prod.outlook.com ([fe80::848c:1057:dabd:55b2%6]) with mapi id 15.20.3955.025; Wed, 24 Mar 2021 01:46:53 +0000 From: Calum Mackay To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 1/2] pynfs: courtesy: use a helper function to prepare the lock op args Date: Wed, 24 Mar 2021 01:46:29 +0000 Message-Id: <20210324014630.2454-2-calum.mackay@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210324014630.2454-1-calum.mackay@oracle.com> References: <20210324014630.2454-1-calum.mackay@oracle.com> X-Originating-IP: [141.143.213.46] X-ClientProxiedBy: AM3PR07CA0065.eurprd07.prod.outlook.com (2603:10a6:207:4::23) To CY4PR1001MB2119.namprd10.prod.outlook.com (2603:10b6:910:3f::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from cdmvmol7.uk.oracle.com (141.143.213.46) by AM3PR07CA0065.eurprd07.prod.outlook.com (2603:10a6:207:4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.9 via Frontend Transport; Wed, 24 Mar 2021 01:46:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e9532ce-9943-4e42-a59f-08d8ee66b2f5 X-MS-TrafficTypeDiagnostic: CY4PR10MB1304: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1oPtsnATYlZc3Mplr2So6Y69Vmluq8pCh+eoFPgrQLKBJix+7CEMQlRu6kypBxGl290pE9jaQcx/pwiXH5XcDoLrbSZbmpoZmf6cfKEW7+Z3oRm1HVCsEQiQyBlndmXRuyRyKkq/9b1ClnN5l01rRVRs8b/c4qi827PMwkGWQWd/Hgp53Tusj002vueKnEI2IuqKAaDS0l+g5BUPR0aOyK1EGToFitZ8D6iR0XP59w0YCs1pSZVva631qrn+WaW4AJ5yICeXVEO07esDhWLkimmtph02Cq31xekK4mTRr4s2/bgAXl9MQXJBpJI0rGwayyCg2H1dxdrLc9jcmktqHoHjloCet7PsYwuCwSTGdKfpEOldwrR79VOoOoNoETyhjy/pw42uaPPBxaJzAbLEGHyJ4KgrICA1MWt1E3ekO+oLDcFVXuRwd4FoyY+ACdsjHyyCjSkvY5Xvf1uNk4aLflZ2TnwpTyPmdqTFDuZuA/SYdbbuSYwIRirkCM8NqBtse2bdbnBKF7pR/740JPBVrrGr7P3eY3iUIatgzkXtLMFKQi0SFWtN9X2kOzypRF5WFMRsMwQPOt4f3SGapUkxN17nHLCXutfGdcosvjyhvXdXj9UcKO+Myq83L5c9+mH85IAWgCCVgYYC5XV22zyoNRAUzgIRqX41jssjcFmCPig= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR1001MB2119.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(376002)(136003)(366004)(396003)(39860400002)(956004)(8936002)(6486002)(2616005)(7696005)(66946007)(6916009)(478600001)(66476007)(66556008)(6666004)(4326008)(26005)(38100700001)(83380400001)(2906002)(5660300002)(186003)(86362001)(16526019)(316002)(44832011)(36756003)(1076003)(52116002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: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jINTF8woCEs6t4TA8ENXRALdNaY+KsEyUFliaTn08gP07Uw+N/3khGrDwXnIokxOLikjICMS9Y6qgim8l4DBqiEY9po2MMI9eniKCYJpm0K9RkwhakDpzQIYPvnvWaoOHHkwUY1FfNEINxJRYwUYrMucg+R5tmWYZWrR9YIVLPCIcEn3stMXAG0F/GI+hM9OUo9p6ij3uPQjPkzjbys+M/SDnkeTo8keyGhfzcsDjhM5It+0SiNXqokpS4RE/pZaz X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8e9532ce-9943-4e42-a59f-08d8ee66b2f5 X-MS-Exchange-CrossTenant-AuthSource: CY4PR1001MB2119.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2021 01:46:53.1402 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D8mVVGdGNO8wvI1Mwo1yj+nNb6+c9NuUuIA3XRA8WXmFGhddWZB5Eoku+NouDh90xaUGbc1agf0cBjjOWqCqoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1304 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9932 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 suspectscore=0 spamscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103240011 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9932 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 bulkscore=0 spamscore=0 adultscore=0 clxscore=1015 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103240010 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Cleanup. Future tests to be added will use the same sequence to prepare the args for the lock op, so use a helper function for that. Signed-off-by: Calum Mackay --- nfs4.1/server41tests/st_courtesy.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/nfs4.1/server41tests/st_courtesy.py b/nfs4.1/server41tests/st_courtesy.py index 5e13dad44a01..e74d9afbca60 100644 --- a/nfs4.1/server41tests/st_courtesy.py +++ b/nfs4.1/server41tests/st_courtesy.py @@ -15,6 +15,12 @@ def _getleasetime(sess): res = sess.compound([op.putrootfh(), op.getattr(1 << FATTR4_LEASE_TIME)]) return res.resarray[-1].obj_attributes[FATTR4_LEASE_TIME] +def cour_lockargs(fh, stateid): + open_to_lock_owner = open_to_lock_owner4( 0, stateid, 0, lock_owner4(0, b"lock1")) + lock_owner = locker4(open_owner=open_to_lock_owner, new_lock_owner=True) + lock_ops = [ op.lock(WRITE_LT, False, 0, NFS4_UINT64_MAX, lock_owner) ] + return [op.putfh(fh)] + lock_ops + def testLockSleepLockU(t, env): """test server courtesy by having LOCK and LOCKU in separate compounds, separated by a sleep of twice the lease period @@ -29,10 +35,7 @@ def testLockSleepLockU(t, env): fh = res.resarray[-1].object stateid = res.resarray[-2].stateid - open_to_lock_owner = open_to_lock_owner4( 0, stateid, 0, lock_owner4(0, b"lock1")) - lock_owner = locker4(open_owner=open_to_lock_owner, new_lock_owner=True) - lock_ops = [ op.lock(WRITE_LT, False, 0, NFS4_UINT64_MAX, lock_owner) ] - res = sess1.compound([op.putfh(fh)] + lock_ops) + res = sess1.compound(cour_lockargs(fh, stateid)) check(res, NFS4_OK) lease_time = _getleasetime(sess1) From patchwork Wed Mar 24 01:46:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calum Mackay X-Patchwork-Id: 12160045 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB76BC433DB for ; Wed, 24 Mar 2021 01:47:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E49C61924 for ; Wed, 24 Mar 2021 01:47:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231802AbhCXBrZ (ORCPT ); Tue, 23 Mar 2021 21:47:25 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:51078 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231960AbhCXBrD (ORCPT ); Tue, 23 Mar 2021 21:47:03 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12O1cuJS141523; Wed, 24 Mar 2021 01:46:56 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 : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=RLqMZa8hCjCY3Ibh/l/ulbIgBGKLpWE9iggsG31t5Vg=; b=GlzS7ovg81bL8xQJG9vTpNGYXduj8MaJsjNTGU+BoGOX4gzJZ7wTaydnj8Yb2kHRcpFT mBTHMImqGxMgegXCqznIEc9otL6fqIPTQzhmXOC1Gfifm+q7sa0zDlTy7ZoUiC/cxj0d uiptg7XO6h3kFAtWhbYs4MG0JUKv0aFXZGszsdpidW8ixfw1M75VrobFTEp1i+lD5YkT cQBMImyhIJABoZcET4vlWNTiuJcjynQWnnp7Bduq4Yisu8nudDe5T2f046SX0uuMKSGr ajrIGC6MFigr6W016wsabDrzfuvDkf8aNMvsujQRs7+ymjX1jwcdZWTFx5hkU5PphNN/ oQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 37d8fr95af-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Mar 2021 01:46:56 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 12O1k92x159138; Wed, 24 Mar 2021 01:46:56 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2057.outbound.protection.outlook.com [104.47.36.57]) by userp3020.oracle.com with ESMTP id 37dttsq9ff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Mar 2021 01:46:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eq4JOGbTHBhSeJuYEm4bojdder6JwstoszQHSGsx8qafz0ei3K6ajhRxfyB0PU5/ma2K/xU96YO80fUJr0PEwWiI9DpU0bcXKAH6NkBkMl2sS3B2fe5cCZgqfBUDv4flZmBWhYp+hs8JZp1ER7SiiAiH3FrhVSvOj02oRm9hsO7kjHazDoKzXEzXhYUO6qPdKoGWDgZHdmooRjRdmhIfNFrUmqCMdVbe5JJjYp0HWizWd1e95rcipkg2QMtXtHz67Z5M+H96zGrpb9fwKKHhME0ZjGIbl6zSJR7HR9oIHBqcWQsZVU0nD7eGxy+37ufsa0tEeR9fkDarOFpLiexsaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RLqMZa8hCjCY3Ibh/l/ulbIgBGKLpWE9iggsG31t5Vg=; b=SBlRem5YmhbmQWjshsvuQ/oXdgUAgXilGYD1AMgy1QybW5tocYAw0v4hSZeMfuGqWXa1hssZ02kfw0ckVvw5/nt4CUG1aIjAObMTsRvD9lPd9LApqOVf37BZ7mguGlTxnxKfBG79aD7oPBN7KJ73VasydMhPbBzbzZHB9Vo+AokX/hEr8vXM6bHt9PLjQrBjq2gdYhQQ/F0PZy4flWmEU4xvzYM/I+f0s1cLyDmtVDBE4WfYaMgK/FIJAf3sLkZpDCkKbT8gwgDuGQUIUUVFJlKez7U9xUIY4Pdc0FU2yFo336sAxqoV+owtALADdvP9GZNMgEZxdQMWktJNDJY03w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RLqMZa8hCjCY3Ibh/l/ulbIgBGKLpWE9iggsG31t5Vg=; b=RWuZMLYclmtpFm6//FZviZ3sDa6tGMvL5lFYJBeVfUWc5Noz1AZX3L2rJ+hNyuFXqqCmHieFaMAa8olXMFtRVwsyVGpYRB/T/qIGmjJV5L5AfvaDetx5l5Q4UNIAPprVlEf5mOz167HFnPaIrr6CPU2QcRr8BJ+bqARPkW/0hms= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=oracle.com; Received: from CY4PR1001MB2119.namprd10.prod.outlook.com (2603:10b6:910:3f::15) by CY4PR10MB1304.namprd10.prod.outlook.com (2603:10b6:903:26::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24; Wed, 24 Mar 2021 01:46:54 +0000 Received: from CY4PR1001MB2119.namprd10.prod.outlook.com ([fe80::848c:1057:dabd:55b2]) by CY4PR1001MB2119.namprd10.prod.outlook.com ([fe80::848c:1057:dabd:55b2%6]) with mapi id 15.20.3955.025; Wed, 24 Mar 2021 01:46:54 +0000 From: Calum Mackay To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 2/2] pynfs: courtesy: add a test to ensure server releases state appropriately Date: Wed, 24 Mar 2021 01:46:30 +0000 Message-Id: <20210324014630.2454-3-calum.mackay@oracle.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210324014630.2454-1-calum.mackay@oracle.com> References: <20210324014630.2454-1-calum.mackay@oracle.com> X-Originating-IP: [141.143.213.46] X-ClientProxiedBy: AM3PR07CA0065.eurprd07.prod.outlook.com (2603:10a6:207:4::23) To CY4PR1001MB2119.namprd10.prod.outlook.com (2603:10b6:910:3f::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from cdmvmol7.uk.oracle.com (141.143.213.46) by AM3PR07CA0065.eurprd07.prod.outlook.com (2603:10a6:207:4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.9 via Frontend Transport; Wed, 24 Mar 2021 01:46:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 68feeb83-b383-43da-1f70-08d8ee66b3ab X-MS-TrafficTypeDiagnostic: CY4PR10MB1304: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 22YZxmn/0BrKLcqOwqgf9PIjyBOrMnmA7MC1JKOLRdO6vu2XCbHyVz7M4LEwmBFOj8c1cSy1BmBgJZR7wLi9Kp8Uf1T1+17pLkUH/4GaR7LGqE4muhV3AyQw+5EFcz0+PyxZyYc7WUqHscItf9HEyvFnH6IGXsjeMXpFitV3PUYzktrkGAcdYTw/15H2Vc+cj8q66nnZnZC5Vqr5SYN6FawmvdvmQX0wHgqUmiS9RizaNy7TcIit+l9mV6Qpoa6xUafT8NCHhF1AWlVgr/B0AKyN8j+tHJISgFvCFCSl/0Ev/y6MNKEWLnE7vAj5kLjPJjI5A75JIE2Aqy69XDs3IS8q0/3Rte9VxEId1U/Qd/vkj0+GgiBzkDVIIDJf0sljS794tELd6bqxPcc9DbGc2jKhGSph2jon+xr/6MdJGVt58Zob0UCL/LuGL3LJ6Ge8qLMnrO2BvJ0q3qwwHtGMs0L7D199+0e7laylmLlSKwoe37EYE2HlWlHycfrzN8w4TLUKraLrwIAbBdIYUnlAZrGdJw0lf+XKeshFSAidwNuLYpqA2YuqkuiZV0NocRYM1ufVH75EVWTFIiotBLo4vRQJGExFpAlGRGI0+enlwK9nH+WmGrQeeTaDTbKO3v8e5C46wxyG2N+dQT31jrd6/w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR1001MB2119.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(376002)(136003)(366004)(396003)(39860400002)(956004)(8936002)(6486002)(2616005)(7696005)(66946007)(6916009)(478600001)(66476007)(66556008)(6666004)(4326008)(26005)(38100700001)(83380400001)(2906002)(5660300002)(186003)(86362001)(16526019)(316002)(44832011)(36756003)(1076003)(52116002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wNupmjEiUqPTBZ6JvSfAYyYTjyKzg0bWGf7RYy4l67Fjqea6VC7jDGr8c/a8+MYTmPGrBLchqlFtFbqUAq8Nai8qCy1GiYeRE4cYu2j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/yz3fC3cv1AWdW5vhrYV0FdAIwkJ3FHHXK8sdb8hcHBu0rp7x5B85fvePQsMFLKXmqn6Y4WqmV/xINq69AV7GWizKtA8Kr0ZbMHWZdC2zRGsmiBzPxFVv63MdnxtSDuIb0ZZY+ZBrK+spzaUSjp8l17Z X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68feeb83-b383-43da-1f70-08d8ee66b3ab X-MS-Exchange-CrossTenant-AuthSource: CY4PR1001MB2119.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2021 01:46:54.2655 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g8uh3NZc3uKNGnEZZKh0lY8mS+/71NVFzF3EfeQ1YWOFMzAstjnmyF00txJL92sGuwjlbFxLkBKoFSZ9CGCPQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1304 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9932 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 spamscore=0 mlxscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103240011 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9932 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 spamscore=0 mlxscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103240010 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This test checks that the server will allow a conflicting lock from a second client, after lease expiry of the first client. This applies to both courteous, and discourteous servers, but ensures that courteous servers don't just hang onto state indefinitely. Signed-off-by: Calum Mackay --- nfs4.1/server41tests/st_courtesy.py | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/nfs4.1/server41tests/st_courtesy.py b/nfs4.1/server41tests/st_courtesy.py index e74d9afbca60..dd911a37772d 100644 --- a/nfs4.1/server41tests/st_courtesy.py +++ b/nfs4.1/server41tests/st_courtesy.py @@ -48,3 +48,36 @@ def testLockSleepLockU(t, env): res = close_file(sess1, fh, stateid=stateid) check(res) + +def testLockSleepLock(t, env): + """ensure that a courteous server will allow a conflicting lock from + a second client, after lease expiry of the first client. + A discourteous server should allow this too, of course. + + FLAGS: courteous all + CODE: COUR2 + """ + + sess1 = env.c1.new_client_session(env.testname(t)) + + res = create_file(sess1, env.testname(t)) + check(res) + + fh = res.resarray[-1].object + stateid = res.resarray[-2].stateid + res = sess1.compound(cour_lockargs(fh, stateid)) + check(res, NFS4_OK) + + lease_time = _getleasetime(sess1) + env.sleep(lease_time * 2, "twice the lease period") + + c2 = env.c1.new_client(b"%s_2" % env.testname(t)) + sess2 = c2.create_session() + + res = open_file(sess2, env.testname(t), access=OPEN4_SHARE_ACCESS_WRITE) + check(res) + + fh = res.resarray[-1].object + stateid = res.resarray[-2].stateid + res = sess2.compound(cour_lockargs(fh, stateid)) + check(res, NFS4_OK)