From: "Mkrtchyan, Tigran" <tigran.mkrtchyan@desy.de>
To: Tom Haynes <loghyr@gmail.com>
Cc: bfields <bfields@redhat.com>, linux-nfs <linux-nfs@vger.kernel.org>
Subject: Re: [pynfs python3 6/7] st_flex: Return the layout before closing the file
Date: Sun, 20 Dec 2020 16:56:45 +0100 (CET) [thread overview]
Message-ID: <2110076167.5569939.1608479805678.JavaMail.zimbra@desy.de> (raw)
In-Reply-To: <20201219182948.83000-7-loghyr@hammerspace.com>
Hi Tom,
works for me as well with fedora33 and dcache server.
Thanks,
Tigran.
----- Original Message -----
> From: "Tom Haynes" <loghyr@gmail.com>
> To: "bfields" <bfields@redhat.com>
> Cc: "linux-nfs" <linux-nfs@vger.kernel.org>
> Sent: Saturday, 19 December, 2020 19:29:47
> Subject: [pynfs python3 6/7] st_flex: Return the layout before closing the file
> From: Tom Haynes <loghyr@excfb.com>
>
> Signed-off-by: Tom Haynes <loghyr@excfb.com>
> ---
> 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)
>
> --
> 2.26.2
next prev parent reply other threads:[~2020-12-20 15:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-19 18:29 [pynfs python3 0/7] Python3 patches for st_flex.py Tom Haynes
2020-12-19 18:29 ` [pynfs python3 1/7] CB_LAYOUTRECALL: Make string a byte array Tom Haynes
2020-12-19 18:29 ` [pynfs python3 2/7] st_flex: Use NFS4_MAXFILELEN in layout calls Tom Haynes
2020-12-19 18:29 ` [pynfs python3 3/7] st_flex: Provide an empty ff_layoutreturn4 by default for LAYOUTRETURN Tom Haynes
2020-12-19 18:29 ` [pynfs python3 4/7] st_flex: Use range instead of xrange for python3 Tom Haynes
2020-12-19 18:29 ` [pynfs python3 5/7] st_flex: Test is now redundant Tom Haynes
2020-12-19 18:29 ` [pynfs python3 6/7] st_flex: Return the layout before closing the file Tom Haynes
2020-12-20 15:56 ` Mkrtchyan, Tigran [this message]
2020-12-19 18:29 ` [pynfs python3 7/7] st_flex: testFlexLayoutStatsSmall needed loving to pass python3 Tom Haynes
2020-12-21 20:00 ` [pynfs python3 0/7] Python3 patches for st_flex.py J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2110076167.5569939.1608479805678.JavaMail.zimbra@desy.de \
--to=tigran.mkrtchyan@desy.de \
--cc=bfields@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=loghyr@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox