From: Jeff Layton <jlayton@kernel.org>
To: Calum Mackay <calum.mackay@oracle.com>
Cc: linux-nfs@vger.kernel.org, Jeff Layton <jlayton@kernel.org>
Subject: [PATCH pynfs v2 1/7] WRT18: have it also check the ctime between writes
Date: Mon, 14 Oct 2024 16:50:21 -0400 [thread overview]
Message-ID: <20241014-cb_getattr-v2-1-3782e0d7c598@kernel.org> (raw)
In-Reply-To: <20241014-cb_getattr-v2-0-3782e0d7c598@kernel.org>
On many servers, the ctime doesn't have sufficient granularity to show
an apparent change between rapid writes, but some are able to do so.
Have the test also check the ctimes here and pass_warn if it doesn't
change after every write.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
nfs4.0/servertests/st_write.py | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/nfs4.0/servertests/st_write.py b/nfs4.0/servertests/st_write.py
index db1b1e585fdbf7169400ba676dd86b46e6c61750..e635717f76c93fc186521688717e25a377de7207 100644
--- a/nfs4.0/servertests/st_write.py
+++ b/nfs4.0/servertests/st_write.py
@@ -497,19 +497,27 @@ def testChangeGranularityWrite(t, env):
c = env.c1
c.init_connection()
fh, stateid = c.create_confirm(t.word())
- ops = c.use_obj(fh) + [c.getattr([FATTR4_CHANGE])] \
- + [op.write(stateid, 0, UNSTABLE4, _text)] + [c.getattr([FATTR4_CHANGE])] \
- + [op.write(stateid, 10, UNSTABLE4, _text)] + [c.getattr([FATTR4_CHANGE])] \
- + [op.write(stateid, 20, UNSTABLE4, _text)] + [c.getattr([FATTR4_CHANGE])] \
- + [op.write(stateid, 30, UNSTABLE4, _text)] + [c.getattr([FATTR4_CHANGE])]
+ attrlist = [FATTR4_CHANGE, FATTR4_TIME_METADATA]
+ ops = c.use_obj(fh) + [c.getattr(attrlist)] \
+ + [op.write(stateid, 0, UNSTABLE4, _text)] + [c.getattr(attrlist)] \
+ + [op.write(stateid, 10, UNSTABLE4, _text)] + [c.getattr(attrlist)] \
+ + [op.write(stateid, 20, UNSTABLE4, _text)] + [c.getattr(attrlist)] \
+ + [op.write(stateid, 30, UNSTABLE4, _text)] + [c.getattr(attrlist)]
res = c.compound(ops)
check(res)
- chattr1 = res.resarray[1].obj_attributes
- chattr2 = res.resarray[3].obj_attributes
- chattr3 = res.resarray[5].obj_attributes
- chattr4 = res.resarray[7].obj_attributes
+ chattr1 = res.resarray[1].obj_attributes[FATTR4_CHANGE]
+ chattr2 = res.resarray[3].obj_attributes[FATTR4_CHANGE]
+ chattr3 = res.resarray[5].obj_attributes[FATTR4_CHANGE]
+ chattr4 = res.resarray[7].obj_attributes[FATTR4_CHANGE]
if chattr1 == chattr2 or chattr2 == chattr3 or chattr3 == chattr4:
- t.fail("consecutive SETATTR(mode)'s don't all change change attribute")
+ t.fail("consecutive WRITE's don't change change attribute")
+
+ ctime1 = res.resarray[1].obj_attributes[FATTR4_TIME_METADATA]
+ ctime2 = res.resarray[3].obj_attributes[FATTR4_TIME_METADATA]
+ ctime3 = res.resarray[5].obj_attributes[FATTR4_TIME_METADATA]
+ ctime4 = res.resarray[7].obj_attributes[FATTR4_TIME_METADATA]
+ if compareTimes(ctime1, ctime2) == 0 or compareTimes(ctime2, ctime3) == 0 or compareTimes(ctime3, ctime4) == 0:
+ t.pass_warn("consecutive WRITE's don't all change time_metadata")
def testStolenStateid(t, env):
"""WRITE with incorrect permissions and somebody else's stateid
--
2.47.0
next prev parent reply other threads:[~2024-10-14 20:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-14 20:50 [PATCH pynfs v2 0/7] pynfs: add CB_GETATTR tests and tests for delegated timestamps Jeff Layton
2024-10-14 20:50 ` Jeff Layton [this message]
2024-10-14 20:50 ` [PATCH pynfs v2 2/7] DELEG2: fix write delegation test to open the file RW Jeff Layton
2024-10-14 20:50 ` [PATCH pynfs v2 3/7] pynfs: update maintainer info Jeff Layton
2024-10-14 20:50 ` [PATCH pynfs v2 4/7] nfs4.1: add two CB_GETATTR tests Jeff Layton
2024-10-14 20:50 ` [PATCH pynfs v2 5/7] nfs4.1: default to minorversion 2 Jeff Layton
2024-10-15 13:43 ` Chuck Lever III
2024-10-15 14:23 ` Jeff Layton
2024-10-15 19:20 ` Chuck Lever III
2024-10-14 20:50 ` [PATCH pynfs v2 6/7] nfs4.1: add support for the "delstid" draft Jeff Layton
2024-10-14 20:50 ` [PATCH pynfs v2 7/7] st_deleg: test delegated timestamps in CB_GETATTR Jeff Layton
2024-10-14 21:24 ` [PATCH pynfs v2 0/7] pynfs: add CB_GETATTR tests and tests for delegated timestamps Calum Mackay
2024-10-22 21:56 ` Calum Mackay
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=20241014-cb_getattr-v2-1-3782e0d7c598@kernel.org \
--to=jlayton@kernel.org \
--cc=calum.mackay@oracle.com \
--cc=linux-nfs@vger.kernel.org \
/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