From patchwork Sat Dec 19 18:29:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 11983641 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 CBDFEC3526D for ; Sat, 19 Dec 2020 18:31:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9691C233A2 for ; Sat, 19 Dec 2020 18:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725562AbgLSSa6 (ORCPT ); Sat, 19 Dec 2020 13:30:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725960AbgLSSa5 (ORCPT ); Sat, 19 Dec 2020 13:30:57 -0500 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68716C0617B0 for ; Sat, 19 Dec 2020 10:30:17 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id c79so3592841pfc.2 for ; Sat, 19 Dec 2020 10:30:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VvrYI53ARyLNi47g0r3LKgEekytDQ9rhf7H5l0uRxuE=; b=ejmtv9lSLpZjFCNpEe2h4SDXV6nzCEJnoqR4PCHRfMio13B36p4FOCespgD2L1MJHr M2BLuBkvAqBgRv7u9IkQop/p16XMCKn6xAPojzl1UMcfsb5KV4oNTFU7z6KawvFVDvyT 6NZyegVP2cE9xm+MN1YgezJVMAInTxZ9p3wC+HinpgHA56VXQJA8jpCvSNk3m8nUuwZY gfly3g5zbGTswBFMSxP77wwlW0zwsgqsvahVcJHcbm+n4ZvLCg6NJMdPA6UxHJJRm+9J DoyufHKG8Jrdsux3TiKRvUJvn0VjssVL8//FDbCsp/vfepX43WpitfzfdNo45GH48+34 gHWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VvrYI53ARyLNi47g0r3LKgEekytDQ9rhf7H5l0uRxuE=; b=dy+YbfEjvnZfs6j3y+mGXBzPKLbnmDV0Fm+F4QVB7ZQdfmUWKN+cJYz+5mQH77JR81 Cnr2gc2LbJGmlbYDxbBXjMMcqDBwKX6cdWb4+BO6Tj2e4ViKoQC/SeHJov3JIKwcsCF7 fsCYPKIbFHsanKW0QSOWTsjywEG15IE6MHIUxbTyw6iFF9SuJtQPZSEPj3LP3EQ+jcNn 45gCBEDG+z3J0H4rt1V4W/yBmPspCe5fHOOgWsUnliGcHeC/P7yMP1Tq6BShFDJxfDmP LiRzhoMOaKUj4VEPki5FBkqF5o249mZ2XMlFQLd0dWkgSprvWkz16xSFJ14w2peSIn3h 1dng== X-Gm-Message-State: AOAM533RjU2FwRwaboPZ+F3nl5mX+LdWbpOEfp+a9Zlr+fM1ubZLcctc BzcBlAghei0oLPfrKae7PDU= X-Google-Smtp-Source: ABdhPJw+KAXKaZkQRpAD9BYyBoJO2do5qIT5Nt+xLrGzqAI7wDvvNw9+bEgZezeqMpQuBsOR30lhAQ== X-Received: by 2002:a65:47c7:: with SMTP id f7mr5093026pgs.305.1608402617024; Sat, 19 Dec 2020 10:30:17 -0800 (PST) Received: from garbo.localdomain (c-69-181-67-218.hsd1.ca.comcast.net. [69.181.67.218]) by smtp.gmail.com with ESMTPSA id l197sm12318471pfd.97.2020.12.19.10.30.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 10:30:16 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Bruce Fields Cc: Linux NFS Mailing list Subject: [pynfs python3 1/7] CB_LAYOUTRECALL: Make string a byte array Date: Sat, 19 Dec 2020 10:29:42 -0800 Message-Id: <20201219182948.83000-2-loghyr@hammerspace.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201219182948.83000-1-loghyr@hammerspace.com> References: <20201219182948.83000-1-loghyr@hammerspace.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Tom Haynes Signed-off-by: Tom Haynes --- nfs4.1/nfs4client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfs4.1/nfs4client.py b/nfs4.1/nfs4client.py index f06d9c5..df573d6 100644 --- a/nfs4.1/nfs4client.py +++ b/nfs4.1/nfs4client.py @@ -296,7 +296,7 @@ class NFS4Client(rpc.Client, rpc.Server): layoutreturn4(LAYOUTRETURN4_FILE, layoutreturn_file4(rclayout.lor_offset, rclayout.lor_length, \ - rclayout.lor_stateid, "")))] + rclayout.lor_stateid, b"")))] env.session.compound(ops) elif lo_recalltype not in [LAYOUTRECALL4_FSID, LAYOUTRECALL4_ALL]: res = NFS4ERR_NOTSUPP From patchwork Sat Dec 19 18:29:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 11983643 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 DC7F8C0018C for ; Sat, 19 Dec 2020 18:31:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AC40323158 for ; Sat, 19 Dec 2020 18:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727211AbgLSSa7 (ORCPT ); Sat, 19 Dec 2020 13:30:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725960AbgLSSa6 (ORCPT ); Sat, 19 Dec 2020 13:30:58 -0500 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1650C061282 for ; Sat, 19 Dec 2020 10:30:18 -0800 (PST) Received: by mail-pg1-x52a.google.com with SMTP id i7so3465569pgc.8 for ; Sat, 19 Dec 2020 10:30:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3LQht4yEOChBiDnMUvNyM2aEUpD3mDtN6ze6YqfxNVk=; b=CIOXdb8YQaE6XlXA2h1o3ZWqZFb7KmCLCnJ7y/2U8zxuhJEQkPJfqtCz1J0ZrKYRn3 v52SbXXeyUnQo3F3+fNYhLGJi+xqINnXQ57LADSGg0T/aTcUg2Wo5LPm4XD9G6SNTCS3 tly5RTR4KEpxLqFMVJ5r5svhIe+szkwCe2gA2rnykd2Qe6GvE5E6vmsnRjuq0lrGqd8d VJvfVcJ4ZKsLBPPOKbx9eeMJOQmIFx6pKMgxXaDyYLcp8dRFHHMzRkYfFTQzKDsdWcN+ pyK3nKRYeRmINSq3lf599990Rw7l5zlbxM2Yx217wrs3jU1S0QVwQEx8mNOHBxnwcR2u +pBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3LQht4yEOChBiDnMUvNyM2aEUpD3mDtN6ze6YqfxNVk=; b=a8CEUzl+ol/40lD3X5SvL3XrXCSm+wCB3FzsHCGdQoq9qPJbEZJvf1WhCvyaJOArjv 9y5Fy1RxwjBHScKPbt+xRiu+r+FU7zseTEuCVxhab5I1sWcjquo7HhFokl44E5OBVY2B kyJnVa/sMhYBl0F1hyc7f5JJguqh/jR3BlM8RPYaySVgQF+AZY4OVgn6H+7dkiKdBmrQ t7ZMZ/czyr/hoG9MgcO9MN1/Gyu9IxIyBulBT5N9TgkX9PMW+Pk/IC4f5pPsU/FXkvep eyepZSXWCP8owRhPZJKCkwlaB1fqBlmIYxOVP0cSq05H4WFVqBGMZVwDxya5K8OGWl1t JQFg== X-Gm-Message-State: AOAM533ZloNTtZuNl0842vEKnxEHE9QyTZTRFbkOoNkK5fM3+uh2gzkk utX+fHq5mku026eG0RGP6VkWZsw6lYbldw== X-Google-Smtp-Source: ABdhPJzaC9zvZsUiPfajOIIEvwV9kk1iYAB3OuOzundzEKKaWzVYz3nii5ATPzm9EqQkOPaqWp4oYg== X-Received: by 2002:a62:97:0:b029:1ab:93bf:43a1 with SMTP id 145-20020a6200970000b02901ab93bf43a1mr7025323pfa.75.1608402618236; Sat, 19 Dec 2020 10:30:18 -0800 (PST) Received: from garbo.localdomain (c-69-181-67-218.hsd1.ca.comcast.net. [69.181.67.218]) by smtp.gmail.com with ESMTPSA id l197sm12318471pfd.97.2020.12.19.10.30.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 10:30:17 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Bruce Fields Cc: Linux NFS Mailing list Subject: [pynfs python3 2/7] st_flex: Use NFS4_MAXFILELEN in layout calls Date: Sat, 19 Dec 2020 10:29:43 -0800 Message-Id: <20201219182948.83000-3-loghyr@hammerspace.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201219182948.83000-1-loghyr@hammerspace.com> References: <20201219182948.83000-1-loghyr@hammerspace.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Tom Haynes Signed-off-by: Tom Haynes --- nfs4.1/server41tests/st_flex.py | 50 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/nfs4.1/server41tests/st_flex.py b/nfs4.1/server41tests/st_flex.py index d70b216..8150054 100644 --- a/nfs4.1/server41tests/st_flex.py +++ b/nfs4.1/server41tests/st_flex.py @@ -5,7 +5,7 @@ import nfs_ops op = nfs_ops.NFS4ops() from .environment import check, fail, create_file, close_file, open_create_file_op from xdrdef.nfs4_pack import NFS4Packer as FlexPacker, \ - NFS4Unpacker as FlexUnpacker + NFS4Unpacker as FlexUnpacker from nfs4lib import FancyNFS4Packer, get_nfstime current_stateid = stateid4(1, '\0' * 12) @@ -69,11 +69,11 @@ def testFlexGetLayout(t, env): open_stateid = res.resarray[-2].stateid ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_READ, - 0, 0xffffffffffffffff, 4196, open_stateid, 0xffff)] + 0, NFS4_MAXFILELEN, 4196, open_stateid, 0xffff)] res = sess.compound(ops) check(res) # Parse opaque - for layout in res.resarray[-1].logr_layout: + for layout in res.resarray[-1].logr_layout: if layout.loc_type == LAYOUT4_FLEX_FILES: p = FlexUnpacker(layout.loc_body) opaque = p.unpack_ff_layout4() @@ -98,7 +98,7 @@ def testFlexLayoutReturnFile(t, env): open_stateid = res.resarray[-2].stateid ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_READ, - 0, 0xffffffffffffffff, 4196, open_stateid, 0xffff)] + 0, NFS4_MAXFILELEN, 4196, open_stateid, 0xffff)] res = sess.compound(ops) check(res) # Return layout @@ -106,7 +106,7 @@ def testFlexLayoutReturnFile(t, env): ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, 0xffffffffffffffff, layout_stateid, "")))] + layoutreturn_file4(0, NFS4_MAXFILELEN, layout_stateid, "")))] res = sess.compound(ops) check(res) res = close_file(sess, fh, stateid=open_stateid) @@ -132,7 +132,7 @@ def testFlexLayoutOldSeqid(t, env): ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_RW, - 0, 0xffffffffffffffff, 8192, open_stateid, 0xffff)] + 0, NFS4_MAXFILELEN, 8192, open_stateid, 0xffff)] res = sess.compound(ops) check(res) lo_stateid = res.resarray[-1].logr_stateid @@ -144,7 +144,7 @@ def testFlexLayoutOldSeqid(t, env): ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_RW, - 0, 0xffffffffffffffff, 8192, lo_stateid, 0xffff)] + 0, NFS4_MAXFILELEN, 8192, lo_stateid, 0xffff)] res = sess.compound(ops) check(res) lo_stateid2 = res.resarray[-1].logr_stateid @@ -156,7 +156,7 @@ def testFlexLayoutOldSeqid(t, env): ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_RW, - 0, 0xffffffffffffffff, 8192, lo_stateid, 0xffff)] + 0, NFS4_MAXFILELEN, 8192, lo_stateid, 0xffff)] res = sess.compound(ops) check(res) lo_stateid3 = res.resarray[-1].logr_stateid @@ -167,7 +167,7 @@ def testFlexLayoutOldSeqid(t, env): ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, 0xffffffffffffffff, lo_stateid, "")))] + layoutreturn_file4(0, NFS4_MAXFILELEN, lo_stateid, "")))] res = sess.compound(ops) check(res, NFS4ERR_OLD_STATEID, "LAYOUTRETURN with an old stateid") res = close_file(sess, fh, stateid=open_stateid) @@ -192,8 +192,8 @@ def testFlexLayoutStress(t, env): for i in range(1000): ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, - LAYOUTIOMODE4_READ if i%2 else LAYOUTIOMODE4_RW, - 0, 0xffffffffffffffff, 8192, lo_stateid, 0xffff)] + LAYOUTIOMODE4_READ if i%2 else LAYOUTIOMODE4_RW, + 0, NFS4_MAXFILELEN, 8192, lo_stateid, 0xffff)] res = sess.compound(ops) check(res) lo_stateid = res.resarray[-1].logr_stateid @@ -203,7 +203,7 @@ def testFlexLayoutStress(t, env): ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, 0xffffffffffffffff, lo_stateid, "")))] + layoutreturn_file4(0, NFS4_MAXFILELEN, lo_stateid, "")))] res = sess.compound(ops) check(res) res = close_file(sess, fh, stateid=open_stateid) @@ -227,7 +227,7 @@ def testFlexGetDevInfo(t, env): ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_RW, - 0, 0xffffffffffffffff, 8192, lo_stateid, 0xffff)] + 0, NFS4_MAXFILELEN, 8192, lo_stateid, 0xffff)] res = sess.compound(ops) check(res) lo_stateid = res.resarray[-1].logr_stateid @@ -251,7 +251,7 @@ def testFlexGetDevInfo(t, env): ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, 0xffffffffffffffff, lo_stateid, "")))] + layoutreturn_file4(0, NFS4_MAXFILELEN, lo_stateid, "")))] res = sess.compound(ops) check(res) res = close_file(sess, fh, stateid=open_stateid) @@ -275,7 +275,7 @@ def testFlexLayoutTestAccess(t, env): ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_RW, - 0, 0xffffffffffffffff, 8192, open_stateid, 0xffff)] + 0, NFS4_MAXFILELEN, 8192, open_stateid, 0xffff)] res = sess.compound(ops) check(res) lo_stateid = res.resarray[-1].logr_stateid @@ -295,7 +295,7 @@ def testFlexLayoutTestAccess(t, env): ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_READ, - 0, 0xffffffffffffffff, 8192, lo_stateid, 0xffff)] + 0, NFS4_MAXFILELEN, 8192, lo_stateid, 0xffff)] res = sess.compound(ops) check(res) lo_stateid = res.resarray[-1].logr_stateid @@ -342,7 +342,7 @@ def testFlexLayoutStatsSmall(t, env): open_op = open_create_file_op(sess, env.testname(t) + str(i), open_create=OPEN4_CREATE) res = sess.compound( open_op + [op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_RW, - 0, 0xffffffffffffffff, 4196, current_stateid, 0xffff)]) + 0, NFS4_MAXFILELEN, 4196, current_stateid, 0xffff)]) check(res, NFS4_OK) lo_stateid = res.resarray[-1].logr_stateid fh = res.resarray[-2].object @@ -395,7 +395,7 @@ def testFlexLayoutStatsSmall(t, env): ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, 0xffffffffffffffff, lo_stateid, p.get_buffer()))), + layoutreturn_file4(0, NFS4_MAXFILELEN, lo_stateid, p.get_buffer()))), op.close(0, open_stateid)] res = sess.compound(ops) check(res) @@ -415,7 +415,7 @@ def _LayoutStats(t, env, stats): ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_RW, - 0, 0xffffffffffffffff, 8192, lo_stateid, 0xffff)] + 0, NFS4_MAXFILELEN, 8192, lo_stateid, 0xffff)] res = sess.compound(ops) check(res) lo_stateid = res.resarray[-1].logr_stateid @@ -455,7 +455,7 @@ def _LayoutStats(t, env, stats): # Did not capture these in the gathered traces offset = 0 - file_length = 0xffffffffffffffff + file_length = NFS4_MAXFILELEN rd_io.ii_count = 0 rd_io.ii_bytes = 0 wr_io.ii_count = 0 @@ -492,7 +492,7 @@ def _LayoutStats(t, env, stats): ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, 0xffffffffffffffff, lo_stateid, "")))] + layoutreturn_file4(0, NFS4_MAXFILELEN, lo_stateid, "")))] res = sess.compound(ops) check(res) res = close_file(sess, fh, stateid=open_stateid) @@ -602,7 +602,7 @@ def layoutget_return(sess, fh, open_stateid, allowed_errors=NFS4_OK, # Get layout ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, layout_iomode, - 0, NFS4_UINT64_MAX, 4196, open_stateid, 0xffff)] + 0, NFS4_MAXFILELEN, 4196, open_stateid, 0xffff)] res = sess.compound(ops) check(res, allowed_errors) if nfsstat4[res.status] is not 'NFS4_OK': @@ -614,7 +614,7 @@ def layoutget_return(sess, fh, open_stateid, allowed_errors=NFS4_OK, ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, NFS4_UINT64_MAX, + layoutreturn_file4(0, NFS4_MAXFILELEN, layout_stateid, "")))] else: # Return layout with error # Get device id @@ -625,7 +625,7 @@ def layoutget_return(sess, fh, open_stateid, allowed_errors=NFS4_OK, deviceid = layout.ffl_mirrors[0].ffm_data_servers[0].ffds_deviceid deverr = device_error4(deviceid, layout_error, layout_error_op) - ffioerr = ff_ioerr4(0, NFS4_UINT64_MAX, layout_stateid, [deverr]) + ffioerr = ff_ioerr4(0, NFS4_MAXFILELEN, layout_stateid, [deverr]) fflr = ff_layoutreturn4([ffioerr], []) p = FlexPacker() @@ -634,7 +634,7 @@ def layoutget_return(sess, fh, open_stateid, allowed_errors=NFS4_OK, ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, NFS4_UINT64_MAX, + layoutreturn_file4(0, NFS4_MAXFILELEN, layout_stateid, p.get_buffer())))] From patchwork Sat Dec 19 18:29:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 11983645 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 1B03CC3526E for ; Sat, 19 Dec 2020 18:31:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D001423372 for ; Sat, 19 Dec 2020 18:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727236AbgLSSbA (ORCPT ); Sat, 19 Dec 2020 13:31:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725960AbgLSSbA (ORCPT ); Sat, 19 Dec 2020 13:31:00 -0500 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03EFCC061285 for ; Sat, 19 Dec 2020 10:30:20 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id x126so3577405pfc.7 for ; Sat, 19 Dec 2020 10:30:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ExE51Jcf7SYoXjqHzJf9S1Nq1Cvr8IAyQypLu6wCUqE=; b=p1JeK01t6Pqfs9HsTB9W//j74en0NlnDIKQkeSKtoWwLFP9Tzfze5sKD/RZDlX6gWS Sv+w+5sQ7i9U71TT2EMVMpYa+qeW86RCTpyOjJw39Rc0m7zcL7sP8Vra4n2ljizWI+WA djNS8j33uTuKohXEe7z4ETquI1sbv05W/6rrto1V5/mgHVX/NhcoPSt/aJcY0yNCj4fE opJm2boYQSXHUrFpNtPNlMd7XISCsj5uLWpiowCx7aQcShoiQk9m4OAYBDkRx6irfu+2 DWc+k9wMWfISEUFT/FDD3RUpQJmJjGnC1OHgHfgtewKF5LUDRw945oTBqggQnrBDeNHP 21Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ExE51Jcf7SYoXjqHzJf9S1Nq1Cvr8IAyQypLu6wCUqE=; b=T61sjVvusjW11HdA4DUKRaOFJu+aEadWZuvLNWMp4natM7DGnvXB0JpRlrRfU5qCYe MYoVm7ovh348obwnKTMmZDVz3YoMLZPJVMlpdCacljEkytunAX/Jr34Z5FuUofMwW1Oh LVw6sIkKutxnDa+ochhsL6A1JCYcc5L6lbUlO9DLzfTsRjk7640BFb9X+mvg9u87zEG2 YshEb06sEkqJqMahQ0e8ctK5piU71W2GKlItENkEGLxcrJ8ygplNDH9Sc8NAFYtPuT+3 lLyVWzBZEVSsrnjAxyTCPBJsZOPOqkDTBixNXnU7EkqqmcjfVGJ5P3Udi3PT2LaomqI8 1PQA== X-Gm-Message-State: AOAM532bAsdm3q/atACvP+QcqAgE+RdtWsxR1IkDfPlUNqvatHa8fUtM rycFNt4b+h3QZkYr5c1f+o2rLrp0pyz9Ig== X-Google-Smtp-Source: ABdhPJz58F17WJvHwTJZo8cdBwNZcCXdtaoYodaT1l5y2DxXbnuH8V0ApbypaW0j2sRKFinSCvYk5A== X-Received: by 2002:a62:1749:0:b029:19d:960c:1bb8 with SMTP id 70-20020a6217490000b029019d960c1bb8mr9429931pfx.63.1608402619600; Sat, 19 Dec 2020 10:30:19 -0800 (PST) Received: from garbo.localdomain (c-69-181-67-218.hsd1.ca.comcast.net. [69.181.67.218]) by smtp.gmail.com with ESMTPSA id l197sm12318471pfd.97.2020.12.19.10.30.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 10:30:19 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Bruce Fields Cc: Linux NFS Mailing list Subject: [pynfs python3 3/7] st_flex: Provide an empty ff_layoutreturn4 by default for LAYOUTRETURN Date: Sat, 19 Dec 2020 10:29:44 -0800 Message-Id: <20201219182948.83000-4-loghyr@hammerspace.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201219182948.83000-1-loghyr@hammerspace.com> References: <20201219182948.83000-1-loghyr@hammerspace.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Tom Haynes Signed-off-by: Tom Haynes --- nfs4.1/server41tests/st_flex.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/nfs4.1/server41tests/st_flex.py b/nfs4.1/server41tests/st_flex.py index 8150054..7036271 100644 --- a/nfs4.1/server41tests/st_flex.py +++ b/nfs4.1/server41tests/st_flex.py @@ -10,6 +10,11 @@ from nfs4lib import FancyNFS4Packer, get_nfstime current_stateid = stateid4(1, '\0' * 12) +empty_fflr = ff_layoutreturn4([], []) + +empty_p = FlexPacker() +empty_p.pack_ff_layoutreturn4(empty_fflr) + def check_seqid(stateid, seqid): if stateid.seqid != seqid: fail("Expected stateid.seqid==%i, got %i" % (seqid, stateid.seqid)) @@ -103,10 +108,12 @@ def testFlexLayoutReturnFile(t, env): check(res) # Return layout layout_stateid = res.resarray[-1].logr_stateid + ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, NFS4_MAXFILELEN, layout_stateid, "")))] + layoutreturn_file4(0, NFS4_MAXFILELEN, + layout_stateid, empty_p.get_buffer())))] res = sess.compound(ops) check(res) res = close_file(sess, fh, stateid=open_stateid) @@ -167,7 +174,8 @@ def testFlexLayoutOldSeqid(t, env): ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, NFS4_MAXFILELEN, lo_stateid, "")))] + layoutreturn_file4(0, NFS4_MAXFILELEN, + lo_stateid, empty_p.get_buffer())))] res = sess.compound(ops) check(res, NFS4ERR_OLD_STATEID, "LAYOUTRETURN with an old stateid") res = close_file(sess, fh, stateid=open_stateid) @@ -203,7 +211,8 @@ def testFlexLayoutStress(t, env): ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, NFS4_MAXFILELEN, lo_stateid, "")))] + layoutreturn_file4(0, NFS4_MAXFILELEN, + lo_stateid, empty_p.get_buffer())))] res = sess.compound(ops) check(res) res = close_file(sess, fh, stateid=open_stateid) @@ -251,7 +260,8 @@ def testFlexGetDevInfo(t, env): ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, NFS4_MAXFILELEN, lo_stateid, "")))] + layoutreturn_file4(0, NFS4_MAXFILELEN, + lo_stateid, empty_p.get_buffer())))] res = sess.compound(ops) check(res) res = close_file(sess, fh, stateid=open_stateid) @@ -395,7 +405,8 @@ def testFlexLayoutStatsSmall(t, env): ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, NFS4_MAXFILELEN, lo_stateid, p.get_buffer()))), + layoutreturn_file4(0, NFS4_MAXFILELEN, + lo_stateid, p.get_buffer()))), op.close(0, open_stateid)] res = sess.compound(ops) check(res) @@ -492,7 +503,8 @@ def _LayoutStats(t, env, stats): ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, - layoutreturn_file4(0, NFS4_MAXFILELEN, lo_stateid, "")))] + layoutreturn_file4(0, NFS4_MAXFILELEN, + lo_stateid, empty_p.get_buffer())))] res = sess.compound(ops) check(res) res = close_file(sess, fh, stateid=open_stateid) @@ -615,7 +627,7 @@ def layoutget_return(sess, fh, open_stateid, allowed_errors=NFS4_OK, op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, layoutreturn_file4(0, NFS4_MAXFILELEN, - layout_stateid, "")))] + layout_stateid, empty_p.get_buffer())))] else: # Return layout with error # Get device id locb = res.resarray[-1].logr_layout[0].lo_content.loc_body From patchwork Sat Dec 19 18:29:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 11983647 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 25A95C3526F for ; Sat, 19 Dec 2020 18:31:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F1D6823158 for ; Sat, 19 Dec 2020 18:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727250AbgLSSbB (ORCPT ); Sat, 19 Dec 2020 13:31:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725960AbgLSSbB (ORCPT ); Sat, 19 Dec 2020 13:31:01 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F393C061248 for ; Sat, 19 Dec 2020 10:30:21 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id w1so6122992pjc.0 for ; Sat, 19 Dec 2020 10:30:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LcafcFsF3exuV6RQUfYdPbxwdszjLSZqLsrKlz4PxyY=; b=NmhEesMHM3Uf17/pswG3ikkNe8UpQhBacEBwRCXkR6dXmhAN5LpBcw6rZIgJhZ30Y8 SOPk686FZrOhjZNqK9bI78FdA2aU688yeMk4lY6JA6g864KBjrEyHtEi8V0lCFGG3oD6 FMBesW9LHyHQIvxFmLWk+V6Q+Hphe2qv5/qMrBQYGT1GVCzfiXfUc5d6Yh44bUihv0s7 1hBcBJ6e4c3CPP317C2FdfNJqxN3mv2/BpjUOOVp5qIqacue4JF08xq5lW4RePfWT1E4 Y4JG6n2QtmlV9g2ke6iTIMuPsWVruQWMOHEfG7mWMcuPxUvSxBBWfW1S/7y1LmtsUH1B XzvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LcafcFsF3exuV6RQUfYdPbxwdszjLSZqLsrKlz4PxyY=; b=YcltKMMJyyojit/M6j27wA1QHWrCXTrtKdoOvNUfftmWCmDMrmuxH9u8nVkTMIeVhv gmj72OtV1oOYKoaykKTqBhYQq1zCS7cW48cxD+r98IEb6wvV4UrndL4SzDBK28Tm1tJx 6a2+r72k+XhcGbJAsiChPL0o3NkQS7lt2tXnPdF6Bnu68KkQgAca2XN0nDJo45KnEqAQ 2WwO1I1BDrtUJgtT5lcFnyAU0If9+oYIjruFPLGLq0yG/+6FBaT/io8CT68M47jTmPd2 /AKPQyh0MdMW9q6aoHiW4144XC2m1qdN/SqYvPqjOEC/cg1VGmQPHbG411FthrbGF2rX PVHA== X-Gm-Message-State: AOAM533cNeTi/VZWsGS5floiJM064zBEBAas5SfZEzcwMAvN/qjmpgFp sr1NC7gTh8aeybqzEdT2Ic0= X-Google-Smtp-Source: ABdhPJwuQv2Xn5osCHGxVRGzfh/DZ3brOypeNmNGmdd+gSScu3NZbHdPspNtVEnTw/7TN8OzgWuFiA== X-Received: by 2002:a17:902:c584:b029:da:cc62:22f1 with SMTP id p4-20020a170902c584b02900dacc6222f1mr9895301plx.54.1608402620870; Sat, 19 Dec 2020 10:30:20 -0800 (PST) Received: from garbo.localdomain (c-69-181-67-218.hsd1.ca.comcast.net. [69.181.67.218]) by smtp.gmail.com with ESMTPSA id l197sm12318471pfd.97.2020.12.19.10.30.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 10:30:20 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Bruce Fields Cc: Linux NFS Mailing list Subject: [pynfs python3 4/7] st_flex: Use range instead of xrange for python3 Date: Sat, 19 Dec 2020 10:29:45 -0800 Message-Id: <20201219182948.83000-5-loghyr@hammerspace.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201219182948.83000-1-loghyr@hammerspace.com> References: <20201219182948.83000-1-loghyr@hammerspace.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Tom Haynes Signed-off-by: Tom Haynes --- nfs4.1/server41tests/st_flex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nfs4.1/server41tests/st_flex.py b/nfs4.1/server41tests/st_flex.py index 7036271..80f5a85 100644 --- a/nfs4.1/server41tests/st_flex.py +++ b/nfs4.1/server41tests/st_flex.py @@ -1106,7 +1106,7 @@ def testFlexLayoutReturn100(t, env): fh = res.resarray[-1].object open_stateid = res.resarray[-2].stateid - for i in xrange(count): + for i in range(count): layout_error = None if i % layout_error_ratio else NFS4ERR_ACCESS layoutget_return(sess, fh, open_stateid, layout_error=layout_error) From patchwork Sat Dec 19 18:29:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 11983651 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 7281FC4361B for ; Sat, 19 Dec 2020 18:31:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 38CDC23158 for ; Sat, 19 Dec 2020 18:31:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727287AbgLSSbi (ORCPT ); Sat, 19 Dec 2020 13:31:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727254AbgLSSbh (ORCPT ); Sat, 19 Dec 2020 13:31:37 -0500 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 906B8C061257 for ; Sat, 19 Dec 2020 10:30:22 -0800 (PST) Received: by mail-pg1-x533.google.com with SMTP id c22so3445088pgg.13 for ; Sat, 19 Dec 2020 10:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sQgD9OtFG7dCo48p/I3yqxvAtbo3rjfCH/WpeBOk0kI=; b=gzFwUKuLvs0HT2kilg27FPUuh6/dLvh8ZAX0fTerqjyssTmoRw9ubb4V1qMVFPATGr uR40VAWHgGA2/NpToYlVy/MOsGwWkCU7b9SvNYWWqjzhDpmh4qOz0bQ9aBr+YtH9SzxN b+Aju4PKg38ZgkTcFe9BugX4XCab+6lOB3b2Trt+VXPrgo/0qziEBb3om0miYo9vPaj6 1yxjiFniaBTb8wuMHzCGyeuHBPJ1rbHxUmNmmOVbWVQFHZ9+AoIEo4erPg0SQXpEeVbm mJGgVSTkg5yCXKp5bZBk35Ha8RjWUOLo1SfnfZHL9XLBQyyHmWMk0CE8rfAiDdpXOScz LSuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sQgD9OtFG7dCo48p/I3yqxvAtbo3rjfCH/WpeBOk0kI=; b=nPqQIz5D20ZeWsYY82Kupxs2SkL64izFBmmDI7yNTtouuIX8pWtvAL2HebVJ318Mcu AaHOCclXTAU4a0z8wtDzN3ldwOt58BohSVIDlCJglWqcQQDUQgw5GXVlp69RjKSp2+3X PBByyUOaxojXxEIZvNwIQwlP8Qx0xVJFAz99MeFBS3yPddljjSFgunNna1jGhKOawbbu 6Z7Jajj05/4bLYFtI+F96JWb4iqq5DQ6H6w55s8+MO5uUvbjPKNuhVmBJirBlRyDuMco tYwPtWXfloFO5Q5kw6Forp+zLaFTpk6+uMVdh2WmVXWq9R75NBvYbh+xFv4LgBnbk1zF 4+1g== X-Gm-Message-State: AOAM532gXsjlXNo4HS1+rDVJNcHyq6mNFFLRiaQgi8LCZLIw76pGgoJ6 JL/KQh0SgR1qBf4zj2gDueVm2Y3oyw5RPg== X-Google-Smtp-Source: ABdhPJzVlhpzV910oQp1Wt037wrr0A8eDbIWYKMkdfmLV19HWH0SDCSqSg1RhIGuGBV4P2UwLVQ7QQ== X-Received: by 2002:a05:6a00:1481:b029:197:fc39:f646 with SMTP id v1-20020a056a001481b0290197fc39f646mr9137291pfu.57.1608402622073; Sat, 19 Dec 2020 10:30:22 -0800 (PST) Received: from garbo.localdomain (c-69-181-67-218.hsd1.ca.comcast.net. [69.181.67.218]) by smtp.gmail.com with ESMTPSA id l197sm12318471pfd.97.2020.12.19.10.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 10:30:21 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Bruce Fields Cc: Linux NFS Mailing list Subject: [pynfs python3 5/7] st_flex: Test is now redundant Date: Sat, 19 Dec 2020 10:29:46 -0800 Message-Id: <20201219182948.83000-6-loghyr@hammerspace.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201219182948.83000-1-loghyr@hammerspace.com> References: <20201219182948.83000-1-loghyr@hammerspace.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Tom Haynes Signed-off-by: Tom Haynes --- nfs4.1/server41tests/st_flex.py | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/nfs4.1/server41tests/st_flex.py b/nfs4.1/server41tests/st_flex.py index 80f5a85..3aae441 100644 --- a/nfs4.1/server41tests/st_flex.py +++ b/nfs4.1/server41tests/st_flex.py @@ -59,39 +59,11 @@ def testStateid1(t, env): res = close_file(sess, fh, stateid=open_stateid) check(res) -def testFlexGetLayout(t, env): - """Verify layout handling - - FLAGS: flex - CODE: FFGLO1 - """ - sess = env.c1.new_pnfs_client_session(env.testname(t)) - # Create the file - res = create_file(sess, env.testname(t)) - check(res) - # Get layout - fh = res.resarray[-1].object - open_stateid = res.resarray[-2].stateid - ops = [op.putfh(fh), - op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_READ, - 0, NFS4_MAXFILELEN, 4196, open_stateid, 0xffff)] - res = sess.compound(ops) - check(res) - # Parse opaque - for layout in res.resarray[-1].logr_layout: - if layout.loc_type == LAYOUT4_FLEX_FILES: - p = FlexUnpacker(layout.loc_body) - opaque = p.unpack_ff_layout4() - p.done() - res = close_file(sess, fh, stateid=open_stateid) - check(res) - def testFlexLayoutReturnFile(t, env): """ Return a file's layout FLAGS: flex - DEPEND: FFGLO1 CODE: FFLOR1 """ sess = env.c1.new_pnfs_client_session(env.testname(t)) From patchwork Sat Dec 19 18:29:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 11983655 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 94726C0018C for ; Sat, 19 Dec 2020 18:31:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67CEA233A2 for ; Sat, 19 Dec 2020 18:31:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727280AbgLSSbi (ORCPT ); Sat, 19 Dec 2020 13:31:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727267AbgLSSbi (ORCPT ); Sat, 19 Dec 2020 13:31:38 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D16C3C0611C5 for ; Sat, 19 Dec 2020 10:30:23 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id w6so3600616pfu.1 for ; Sat, 19 Dec 2020 10:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s6bMc0aGhzA4oq/xkgQc+hzFOQE775/LkpcBnjPq4e0=; b=L0kU7eh3D0EepnHq0Hw8kiF8GSBtjHkoEly7BKQUhnLSZUnBdZEPpyPHYQ+3ppsiNd ZwiyfIIJk77GWlHTauT06F+X179yvW8OB8VanB2diUDpv6OJ+UDWcuoVevM8AsXdU8Xk uxmfNCl/OkYvcMZwLZJKn1CCs+oPTDv6lW02KNDZfQLpvvI2O38cG34ArwhcnuK9rgec xCg2Mq0E5YaFMj5uUHtjBiU1kSGu13IobCi9WkWAF+HPfEG+UFUMWb+wo3eiNKbpYxIH nXpDEHZwnWe0U5XxvtYJ8qEcUbDDHAxhS5eUWedGNivr5GIReOx6KplTsGdDl8g5fazF FLnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=s6bMc0aGhzA4oq/xkgQc+hzFOQE775/LkpcBnjPq4e0=; b=hN5dI8uYJc9lohO9RYk3igZ5c1jmEgG8arxjekb+e3Dz2xPZJOSiGeCJyzgm0srjgu RmTg4IMR0fgRejE/0xl1TQkZBq1K7Ot+MSZDE90OSdm8dyC3NtR4lOAWVHdSed3Bq9xd mMXCG536xMItmb3OcFjOk2VqpmrkIrCGl1YilqSi7JnREdnjyFbjD/vcpHK4pQH6JTjI 2Ij9izpn14hzB+IIGXHfZRG5NK3ewp6HV05xA3i3iLDsfppGXKD+49czk5BlpzjN4bXP XkAmX48sdlPMUE41ZQlqx3seyunC4MGNbBI/regbYy0kWsa4WJTUrWWtQdFGXU3kiLpR z82w== X-Gm-Message-State: AOAM533GOHfKfK4x9ibjmKjWbbVUgACoOs2EGat+o7Sk9X5zoXhRh3Hx IOSJicMju2zatTYmaFAMh668Fu+hzysxzA== X-Google-Smtp-Source: ABdhPJyHGJNJdTs+H1TOfWmYM/wWlF/5AENw8sbEmYPoZ/dpGbqGCfxQbH6WXEpqNbmf9CyubZQs2g== X-Received: by 2002:a63:2045:: with SMTP id r5mr9257428pgm.6.1608402623404; Sat, 19 Dec 2020 10:30:23 -0800 (PST) Received: from garbo.localdomain (c-69-181-67-218.hsd1.ca.comcast.net. [69.181.67.218]) by smtp.gmail.com with ESMTPSA id l197sm12318471pfd.97.2020.12.19.10.30.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 10:30:22 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Bruce Fields Cc: Linux NFS Mailing list Subject: [pynfs python3 6/7] st_flex: Return the layout before closing the file Date: Sat, 19 Dec 2020 10:29:47 -0800 Message-Id: <20201219182948.83000-7-loghyr@hammerspace.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201219182948.83000-1-loghyr@hammerspace.com> References: <20201219182948.83000-1-loghyr@hammerspace.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Tom Haynes Signed-off-by: Tom Haynes --- nfs4.1/server41tests/st_flex.py | 40 +++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/nfs4.1/server41tests/st_flex.py b/nfs4.1/server41tests/st_flex.py index 3aae441..2b1820c 100644 --- a/nfs4.1/server41tests/st_flex.py +++ b/nfs4.1/server41tests/st_flex.py @@ -56,6 +56,15 @@ def testStateid1(t, env): # the server increments by one the value of the "seqid" in each # subsequent LAYOUTGET and LAYOUTRETURN response, check_seqid(lo_stateid, i + 2) + + ops = [op.putfh(fh), + op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, + layoutreturn4(LAYOUTRETURN4_FILE, + layoutreturn_file4(0, NFS4_MAXFILELEN, + lo_stateid, empty_p.get_buffer())))] + res = sess.compound(ops) + check(res) + res = close_file(sess, fh, stateid=open_stateid) check(res) @@ -79,13 +88,13 @@ def testFlexLayoutReturnFile(t, env): res = sess.compound(ops) check(res) # Return layout - layout_stateid = res.resarray[-1].logr_stateid + lo_stateid = res.resarray[-1].logr_stateid ops = [op.putfh(fh), op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, layoutreturn4(LAYOUTRETURN4_FILE, layoutreturn_file4(0, NFS4_MAXFILELEN, - layout_stateid, empty_p.get_buffer())))] + lo_stateid, empty_p.get_buffer())))] res = sess.compound(ops) check(res) res = close_file(sess, fh, stateid=open_stateid) @@ -150,6 +159,15 @@ def testFlexLayoutOldSeqid(t, env): lo_stateid, empty_p.get_buffer())))] res = sess.compound(ops) check(res, NFS4ERR_OLD_STATEID, "LAYOUTRETURN with an old stateid") + + ops = [op.putfh(fh), + op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, + layoutreturn4(LAYOUTRETURN4_FILE, + layoutreturn_file4(0, NFS4_MAXFILELEN, + lo_stateid3, empty_p.get_buffer())))] + res = sess.compound(ops) + check(res) + res = close_file(sess, fh, stateid=open_stateid) check(res) @@ -260,8 +278,8 @@ def testFlexLayoutTestAccess(t, env): 0, NFS4_MAXFILELEN, 8192, open_stateid, 0xffff)] res = sess.compound(ops) check(res) - lo_stateid = res.resarray[-1].logr_stateid - check_seqid(lo_stateid, 1) + lo_stateid1 = res.resarray[-1].logr_stateid + check_seqid(lo_stateid1, 1) layout = res.resarray[-1].logr_layout[-1] p = FlexUnpacker(layout.loc_body) @@ -277,11 +295,11 @@ def testFlexLayoutTestAccess(t, env): ops = [op.putfh(fh), op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_READ, - 0, NFS4_MAXFILELEN, 8192, lo_stateid, 0xffff)] + 0, NFS4_MAXFILELEN, 8192, lo_stateid1, 0xffff)] res = sess.compound(ops) check(res) - lo_stateid = res.resarray[-1].logr_stateid - check_seqid(lo_stateid, 2) + lo_stateid2 = res.resarray[-1].logr_stateid + check_seqid(lo_stateid2, 2) layout = res.resarray[-1].logr_layout[-1] p = FlexUnpacker(layout.loc_body) @@ -300,6 +318,14 @@ def testFlexLayoutTestAccess(t, env): if gid_rw != gid_rd: fail("Expected gid_rd == %s, got %s" % (gid_rd, gid_rw)) + ops = [op.putfh(fh), + op.layoutreturn(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_ANY, + layoutreturn4(LAYOUTRETURN4_FILE, + layoutreturn_file4(0, NFS4_MAXFILELEN, + lo_stateid2, empty_p.get_buffer())))] + res = sess.compound(ops) + check(res) + res = close_file(sess, fh, stateid=open_stateid) check(res) From patchwork Sat Dec 19 18:29:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 11983653 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 7B901C3526C for ; Sat, 19 Dec 2020 18:31:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4F59123372 for ; Sat, 19 Dec 2020 18:31:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727254AbgLSSbi (ORCPT ); Sat, 19 Dec 2020 13:31:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727280AbgLSSbi (ORCPT ); Sat, 19 Dec 2020 13:31:38 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E121C0611CA for ; Sat, 19 Dec 2020 10:30:25 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id b5so3304974pjl.0 for ; Sat, 19 Dec 2020 10:30:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2dQ16zpkiKKpGEq/9mPVqRKfARPz8/ZOcbiS4ymT8+s=; b=doz7o2Gx4PtUwUoD6tVeWgOhl6F4CQ1gIsNWFIIredy1w+/0XUKZLil35uRGtFSCts kh0pMdEAJuzwlHgMIZNG8F1saqJuqL6XvH1v7QAeMBtDSCeVG9lRUUPPIaIOQiiMyrcy Ub3wls8q5yCJ0VQVgCCHLNEy3sUFWPMaTjFUi8+9pS2F2dHGWkV86z4hPWaz/Sele6b3 U4SyxhM44MEGosTNpfAw+6Qf5N+pnXOqYlD6UaiMjs6R6by2V+Qd4+cYtA3FPB9iHKFh ctJlF+u+9Xc4cWT8+yyg9rHTIIFL72BRMh9GexXRJmXLf8COM6RQPaqEHx7qQZgHioa9 ZHVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2dQ16zpkiKKpGEq/9mPVqRKfARPz8/ZOcbiS4ymT8+s=; b=L36bHELz6u59jNMr474TWRXy6ra5XS+6Ce7XzpjbNmv3dhbEGh31uKEFoz6ci9pnY8 Wt1vbt7aOnoo1ZkfnE+4edKeenYuX+ePB9vUb72gRjbFbcvAhn3+nBjtHDwQIEs9+knk JxMADhkP2ijQxFKdhGechX1uGfDWxiDUpYtVWa7kTBAlBSnfg2qAdyMmUKtYt4L5lo0c YMydrbVyoMjyUP9P8fu/BtrdrAIRBpLH2OECQ59E+XPkFBwd77b5NWNjbEcnEAVnyoMJ MxuQZxU65xPfNfnU4biGE5lh9sttGN3yy2aLkHKwRNWupE0N640KO/l8+vghzaKWj7+J oSpw== X-Gm-Message-State: AOAM531XgUbrHsYl6nk1U+3+4OYoHjNanv3ze8SSPruiPn9TGPIaVAy/ imi42r/hNyGm2qHT2k/EYHg= X-Google-Smtp-Source: ABdhPJyrVEG0Yc8yCmSh5oYd6vuH3M29AK4d6hGsxBA1QbEs8YdzFYGwZzNCOY+lwE2siYT5Lbj/Zg== X-Received: by 2002:a17:90a:193:: with SMTP id 19mr10020163pjc.45.1608402624645; Sat, 19 Dec 2020 10:30:24 -0800 (PST) Received: from garbo.localdomain (c-69-181-67-218.hsd1.ca.comcast.net. [69.181.67.218]) by smtp.gmail.com with ESMTPSA id l197sm12318471pfd.97.2020.12.19.10.30.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 10:30:24 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Bruce Fields Cc: Linux NFS Mailing list Subject: [pynfs python3 7/7] st_flex: testFlexLayoutStatsSmall needed loving to pass python3 Date: Sat, 19 Dec 2020 10:29:48 -0800 Message-Id: <20201219182948.83000-8-loghyr@hammerspace.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201219182948.83000-1-loghyr@hammerspace.com> References: <20201219182948.83000-1-loghyr@hammerspace.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Tom Haynes Signed-off-by: Tom Haynes --- nfs4.1/server41tests/st_flex.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nfs4.1/server41tests/st_flex.py b/nfs4.1/server41tests/st_flex.py index 2b1820c..169db69 100644 --- a/nfs4.1/server41tests/st_flex.py +++ b/nfs4.1/server41tests/st_flex.py @@ -8,7 +8,7 @@ from xdrdef.nfs4_pack import NFS4Packer as FlexPacker, \ NFS4Unpacker as FlexUnpacker from nfs4lib import FancyNFS4Packer, get_nfstime -current_stateid = stateid4(1, '\0' * 12) +current_stateid = stateid4(1, b'\0' * 12) empty_fflr = ff_layoutreturn4([], []) @@ -347,8 +347,8 @@ def testFlexLayoutStatsSmall(t, env): sess = env.c1.new_pnfs_client_session(env.testname(t)) for i in range(len(lats)): - open_op = open_create_file_op(sess, env.testname(t) + str(i), open_create=OPEN4_CREATE) - res = sess.compound( open_op + + open_op = open_create_file_op(sess, b'%s_%i' % (env.testname(t), i), open_create=OPEN4_CREATE) + res = sess.compound(open_op + [op.layoutget(False, LAYOUT4_FLEX_FILES, LAYOUTIOMODE4_RW, 0, NFS4_MAXFILELEN, 4196, current_stateid, 0xffff)]) check(res, NFS4_OK)