From patchwork Sun Nov 27 06:26:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 9448693 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1399A6071C for ; Sun, 27 Nov 2016 06:27:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF70A212D9 for ; Sun, 27 Nov 2016 06:27:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E18E122376; Sun, 27 Nov 2016 06:27:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 684F520855 for ; Sun, 27 Nov 2016 06:27:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752167AbcK0G1d (ORCPT ); Sun, 27 Nov 2016 01:27:33 -0500 Received: from us-smtp-delivery-194.mimecast.com ([63.128.21.194]:58398 "EHLO us-smtp-delivery-194.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbcK0G1b (ORCPT ); Sun, 27 Nov 2016 01:27:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=PrimaryData.onmicrosoft.com; s=selector1-primarydata-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=NEsdrSLDU2LXwyhV59sKwBtsNkWjYYmPYQYv58Ult/4=; b=BuZhW6BD9uxp6n88nnHO4b4JPOQR/RW7UgmD/ZnQ/8fXGYasj4MmOYXnjfR+/v0qIWvFHteqiVPWNT7vAfD5pQntD0x5jGJeE4tmLdrT2K4qxbpMxaFJGa4jHc8qNBDJoSV0jOy1IldgTOHmA2cAj5cdVJFMt+8lIvVWUk46Buk= Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02lp0024.outbound.protection.outlook.com [216.32.180.24]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-92-8tiFGbiFON60GKtQPNkVhg-1; Sun, 27 Nov 2016 01:27:28 -0500 Received: from jhereg.localdomain (73.202.55.195) by BN6PR11MB1364.namprd11.prod.outlook.com (10.173.33.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.747.10; Sun, 27 Nov 2016 06:27:20 +0000 From: Tom Haynes To: "J. Bruce Fields" CC: Linux NFS Mailing list Subject: [PATCH pynfs 03/12] Some more file closes to cleanup state on the server Date: Sat, 26 Nov 2016 22:26:32 -0800 Message-ID: <1480228001-64821-4-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 2.3.6 In-Reply-To: <1480228001-64821-1-git-send-email-loghyr@primarydata.com> References: <1480228001-64821-1-git-send-email-loghyr@primarydata.com> MIME-Version: 1.0 X-Originating-IP: [73.202.55.195] X-ClientProxiedBy: DM2PR07CA0047.namprd07.prod.outlook.com (10.141.52.175) To BN6PR11MB1364.namprd11.prod.outlook.com (10.173.33.8) X-MS-Office365-Filtering-Correlation-Id: 2564e6cc-b2bd-4cd5-8167-08d4168e7142 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN6PR11MB1364; X-Microsoft-Exchange-Diagnostics: 1; BN6PR11MB1364; 3:Az9Gf87CG3xdjgmGc57G1zt2dz3FXFZH7UXzM9N4mvUEfaMJGgWeSTPwoqo2gI/zO+aEykVpI/PgfMNHrXkMF1OfR0inic7KA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HVZCNhg/lMwb0VlcjaG0kXKljcGQUieYAj3mWe8aQ6G1EWGReWMWae2x1fZ9UT7NEoEvcakhnbJ38XbLkq2zMcgy1+QY0SBm7TvQSAaJt5HkWXhaJkAY3ysMOPTjgDq0iksMAPCqY3Vln6H18yxhiAWT5e5SLBRxGsiFy9L7KvUrzx+Bw4nQHcZCU6EySihhUkBw7TZKx73SZ5EHF/G6Z9rMaVmV8lkDTexbY7+OLqZ1DjyUgf5+ah6ZzsKbz0CV300fo+qZm8LY=; 20:5IWv/GErvLdsljaVULpsbSLKoD279qk69tBBTcOJmvY9m1L+kHBwdKudLrKvCclEgA6NgGC3sbRw4ynflGpJi3kBzMtvUqUwrcA0cPMmFcyLVAvtN0l4feRgkmRb/j/X2r2BOl9MPp0VUWAuckJmFoScg3j83WSKzu2BqLm8yzA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6060326)(6045199)(6040361)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(6061324)(20161123560025)(2016111802025)(20161123555025)(20161123564025)(20161123562025)(6043046)(6042181); SRVR:BN6PR11MB1364; BCL:0; PCL:0; RULEID:; SRVR:BN6PR11MB1364; X-Microsoft-Exchange-Diagnostics: 1; BN6PR11MB1364; 4:cqejRNWZvij9jkMFcnK/nf3wavPGR+ZNMbUZCOeoCn8RqGFRrtmstAz4y/URufjK8CII+H3ZNeJ0wCcckntpGznrUAw+9WfrP3sgV+Lk0Z23Bo/rKWpxeWrMkEE5SHbrRbjIx7yoeWRefyVlK5ahzdvwgmR5E4aCWbRTHSlaweeROOghU3/ggkCxZAR+YEf7JAvpgXmLHT+qLUrn7yxVATAwyOZsGbF/86bGy2z7w/2jICJcsONdqyPFElkkFh5Ar3ihxCTVHbVYFcjD69aPnG6HMsi87Pf/ffrVgkQuza0An2Fgdnl7P5VC4fzLNTbv5SgXOlqLeC9DSaok0b4Uqoj5uqVOmzZLLzn/QAlFuapotM3GBU7d0gNJx/D+wQ06n+4Lk48EJlLRAtiu1SZL/TL8peuabsKcBYmq54I0TMA6IR1IKpvvgbEs36YGB6MMUmgmXJEpFzpj1WaIZddfC8M/yxglTLl8jzyvmqISVbuXWGOw2qf9BG4MKssCyplY9CNfPZT8nvPJfkxqj2d5ouceFvjDmHWmQh3G8rSu6lOwZW21wV5om/hQrJPriB3fuxWKvQPLDwyxtz4UCp7kwqMTCpxyhbm4mrM5OXGCUWfAo8kyGz9SLYQphADVuGQSijIFn7PuvOLRUBsb5fqnv+dU4Z3HYtMUYRFdZO2X3LajDROks7pVIl61CbQIRfPoeP+AFxawoTjWNoU6zs+y+nHzUikdOmI8XeycT8V8K7E= X-Forefront-PRVS: 0139052FDB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(199003)(189002)(50986999)(86362001)(575784001)(5003940100001)(68736007)(305945005)(7736002)(7846002)(105586002)(101416001)(97736004)(42186005)(92566002)(76176999)(36756003)(66066001)(38730400001)(47776003)(110136003)(33646002)(106356001)(733004)(2950100002)(50466002)(8676002)(6916009)(6666003)(81166006)(81156014)(4326007)(50226002)(5660300001)(48376002)(2906002)(6116002)(3846002)(6486002)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR11MB1364; H:jhereg.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR11MB1364; 23:mpRMwSzVVT8P/btLHFeJ7cCtqGw2cQN5zUYRYJVWv?= =?us-ascii?Q?oE2Kv00vE0DNJZhv6AGWeNDlvCJMYDx0KSHFqEC9lHN4xFX5vn2vDtWBwO7o?= =?us-ascii?Q?1R4lx5Equ3L+qz6SQh8yQX9STJOYTVuEBriHSawC7CB/aRHGjpKrmeZ3r2xr?= =?us-ascii?Q?UWXH+8yCOk3FK1qx9gFwh2GCz4sQ5eoy0+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oaQC2TtVB18+C9Hnod3qnkbVKXK98weiSk05nK2Mw/haFZ0ig6UOJLQS8CpxdcuDDCh4Jyefl6iWXVP6aTPffdcoTxpE/B4MJqxd6vrfgdOCaJ4fut433lWWfZuT6JcVxG0AacDFlHtPFpqdjt1fAXDKBk09CbcY84DrnZ/KQp50e3qstd4Gr8QiBgIw7lrT4A1rhHLZMiEftFN7cPtrIckEBjcJq/kcdoKXin53Opsher3IHhsXGCnNw9SfskK3ASulkh/y+4b6ATQpq7/07Nhf9PGG05QztdlnnMwv45ioL+RUS+uhVqnJuFw==; 20:J77SvF4Tu5Qu2XDD8tJJ7ixbZcFkrmV+XSW1BmNJ7fQuPs9oA0782DI282jwr5CSPjDakXL7PQiKFI4PFxB7rJWB8d4YH84cvxFC/GLlY9Up+DLjcvzVw7HrnydQykiqKqw/y0BI3ILgcHnYTaKhl+i3JBiFApOcY9S1ISwCM9U= X-OriginatorOrg: primarydata.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Nov 2016 06:27:20.3560 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR11MB1364 X-MC-Unique: 8tiFGbiFON60GKtQPNkVhg-1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Tom Haynes --- nfs4.1/server41tests/st_current_stateid.py | 12 +++++++++++- nfs4.1/server41tests/st_debug.py | 18 ++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/nfs4.1/server41tests/st_current_stateid.py b/nfs4.1/server41tests/st_current_stateid.py index a0d6757..01d78c0 100644 --- a/nfs4.1/server41tests/st_current_stateid.py +++ b/nfs4.1/server41tests/st_current_stateid.py @@ -46,6 +46,8 @@ def testLockLockU(t, env): op.locku(WRITE_LT, 0, current_stateid, 0, NFS4_UINT64_MAX) ] res = sess1.compound([op.putfh(fh)] + lock_ops) check(res, NFS4_OK) + res = close_file(sess1, fh, stateid=stateid) + check(res) def testOpenWriteClose(t, env): """test current state id processing by having OPEN, WRITE and CLOSE @@ -132,6 +134,10 @@ def testOpenLayoutGet(t, env): [op.layoutget(False, LAYOUT4_NFSV4_1_FILES, LAYOUTIOMODE4_RW, 0, 8192, 8192, current_stateid, 0xffff)]) check(res, NFS4_OK) + fh = res.resarray[-1].object + stateid = res.resarray[-2].stateid + res = close_file(sess, fh, stateid=stateid) + check(res) def testOpenSetattr(t, env): """test current state id processing by having OPEN and SETATTR @@ -145,8 +151,12 @@ def testOpenSetattr(t, env): open_op = open_create_file_op(sess, env.testname(t), open_create=OPEN4_CREATE) res = sess.compound( open_op + - [ op.setattr(current_stateid, {FATTR4_SIZE: size})]) + [op.getfh(), op.setattr(current_stateid, {FATTR4_SIZE: size})]) check(res, NFS4_OK) + fh = res.resarray[-3].object + stateid = res.resarray[-4].stateid + res = close_file(sess, fh, stateid=stateid) + check(res) def testOpenFreestateidClose(t, env): """test current state id processing by having OPEN, FREE_STATEID and CLOSE diff --git a/nfs4.1/server41tests/st_debug.py b/nfs4.1/server41tests/st_debug.py index 2b9890e..532ee7a 100644 --- a/nfs4.1/server41tests/st_debug.py +++ b/nfs4.1/server41tests/st_debug.py @@ -1,6 +1,6 @@ from st_create_session import create_session from xdrdef.nfs4_const import * -from environment import check, fail, create_file +from environment import check, fail, create_file, close_file from xdrdef.nfs4_type import open_owner4, openflag4, createhow4, open_claim4 import nfs_ops op = nfs_ops.NFS4ops() @@ -19,6 +19,8 @@ def testSupported2(t, env): access=OPEN4_SHARE_ACCESS_READ | OPEN4_SHARE_ACCESS_WANT_READ_DELEG) check(res) # STUB Should check delegation was granted + fh1 = res.resarray[-1].object + stateid1 = res.resarray[-2].stateid # c2 - OPEN - WRITE c2 = env.c1.new_client("%s_2" % env.testname(t)) sess2 = c2.create_session() @@ -31,6 +33,12 @@ def testSupported2(t, env): # STUB - since we are not handling callback, deleg_return never gets done print res check(res) + fh2 = res.resarray[-1].object + stateid2 = res.resarray[-2].stateid + res = close_file(sess1, fh1, stateid=stateid1) + check(res) + res = close_file(sess2, fh2, stateid=stateid2) + check(res) def testReadWrite(t, env): """Do a simple READ and WRITE @@ -58,7 +66,8 @@ def testReadWrite(t, env): res = sess1.compound([op.putfh(fh), op.read(stateid, 0, 1000)]) print res check(res) - + res = close_file(sess1, fh, stateid=stateid) + check(res) def testDeadlock(t, env): """Trigger deadlock bug @@ -87,6 +96,8 @@ def testDeadlock(t, env): res = sess1.listen(xid) check(res) print res + res = close_file(sess1, fh, stateid=stateid) + check(res) def testLayout(t, env): """Verify layout handling @@ -103,11 +114,14 @@ def testLayout(t, env): check(openres) # Get a layout fh = openres.resarray[-1].object + stateid = res.resarray[-2].stateid ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_BLOCK_VOLUME, LAYOUTIOMODE4_READ, 0, 0xffffffff, 4*blocksize, 0xffff)] res = sess.compound(ops) check(res) + res = close_file(sess1, fh, stateid=stateid) + check(res) def testGetDevList(t, env): """Check devlist