From: Deepa Dinamani <deepa.kernel@gmail.com>
To: fstests@vger.kernel.org
Cc: amir73il@gmail.com, arnd@arndb.de, gregkh@linuxfoundation.org,
guaneryu@gmail.com, sashal@kernel.org, y2038@lists.linaro.org
Subject: [PATCH v3 1/1] generic/402: Make timestamp range check conditional
Date: Sat, 18 Jan 2020 16:57:44 -0800 [thread overview]
Message-ID: <20200119005744.12852-1-deepa.kernel@gmail.com> (raw)
In-Reply-To: <CABeXuvoDnwS5Km657iDwgWVL=L3muqqJp51owc0kkNcTFRrEYw@mail.gmail.com>
Addition of fs-specific timestamp range checking was added
in 188d20bcd1eb ("vfs: Add file timestamp range support").
Add a check for whether the kernel supports the limits check
before running the associated test.
Based on an off-list discussion, we use a simpler interim approach
until fsinfo syscall would provide fs timestamp limits info.
This isn't perfect, but works for filesystems expiring in 2038.
Suggested-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
---
common/rc | 7 +++++++
tests/generic/402 | 13 ++++++++++---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/common/rc b/common/rc
index eeac1355..fc82c17a 100644
--- a/common/rc
+++ b/common/rc
@@ -1990,6 +1990,13 @@ _require_timestamp_range()
if [ $tsmin -eq -1 -a $tsmax -eq -1 ]; then
_notrun "filesystem $FSTYP timestamp bounds are unknown"
fi
+
+ # expect console warning from rw scratch mount if fs limit is near
+ if [ $tsmax -le $((1<<31)) ] && \
+ ! _check_dmesg_for "filesystem being mounted at .* supports timestamps until"
+ then
+ _notrun "Kernel does not support timestamp limits"
+ fi
}
_filesystem_timestamp_range()
diff --git a/tests/generic/402 b/tests/generic/402
index 0392c258..2a34d127 100755
--- a/tests/generic/402
+++ b/tests/generic/402
@@ -16,7 +16,13 @@ echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
-trap "exit \$status" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
# Get standard environment, filters and checks.
. ./common/rc
@@ -30,6 +36,7 @@ rm -f $seqres.full
_supported_fs generic
_supported_os Linux
_require_scratch
+_require_check_dmesg
_require_xfs_io_command utimes
# Compare file timestamps obtained from stat
@@ -80,6 +87,8 @@ run_test()
}
_scratch_mkfs &>> $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mount || _fail "scratch mount failed"
+
_require_timestamp_range $SCRATCH_DEV
read tsmin tsmax <<<$(_filesystem_timestamp_range $SCRATCH_DEV)
@@ -96,8 +105,6 @@ declare -a TIMESTAMPS=(
$((tsmax+1))
)
-_scratch_mount || _fail "scratch mount failed"
-
status=0
# Begin test case 1
--
2.17.1
next prev parent reply other threads:[~2020-01-19 0:57 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-19 4:12 [PATCH] generic/402: fix for updated behavior of timestamp limits Deepa Dinamani
2019-07-21 16:47 ` Eryu Guan
2019-10-02 22:06 ` Deepa Dinamani
2019-10-05 18:35 ` Eryu Guan
2019-10-23 22:17 ` Deepa Dinamani
2019-12-12 13:11 ` Amir Goldstein
2019-12-12 21:55 ` Deepa Dinamani
2019-12-18 20:21 ` Deepa Dinamani
2019-12-18 20:46 ` Amir Goldstein
2019-12-19 8:28 ` [Y2038] " Arnd Bergmann
2019-12-19 8:40 ` Greg KH
2019-12-19 11:29 ` Arnd Bergmann
2019-12-19 11:35 ` Greg KH
2019-12-19 15:48 ` Ben Hutchings
2019-12-19 20:35 ` Arnd Bergmann
2019-12-19 12:09 ` Amir Goldstein
2019-12-20 22:45 ` Deepa Dinamani
2019-12-23 5:16 ` [PATCH] generic/402: Make timestamp range check conditional Deepa Dinamani
2019-12-23 6:36 ` Amir Goldstein
2019-12-24 1:15 ` Deepa Dinamani
2019-12-28 22:13 ` [PATCH v2] " Deepa Dinamani
2019-12-30 7:34 ` Amir Goldstein
2020-01-03 6:46 ` Deepa Dinamani
2020-01-03 9:58 ` Amir Goldstein
2020-01-08 8:09 ` Eryu Guan
2020-01-08 8:45 ` Amir Goldstein
2020-01-08 9:50 ` Eryu Guan
2020-01-17 9:09 ` Amir Goldstein
2020-01-17 18:23 ` Deepa Dinamani
2020-01-17 19:01 ` Deepa Dinamani
2020-01-19 0:57 ` Deepa Dinamani [this message]
2020-01-19 9:19 ` [PATCH v3 1/1] " Amir Goldstein
2020-02-01 9:14 ` Eryu Guan
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=20200119005744.12852-1-deepa.kernel@gmail.com \
--to=deepa.kernel@gmail.com \
--cc=amir73il@gmail.com \
--cc=arnd@arndb.de \
--cc=fstests@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=guaneryu@gmail.com \
--cc=sashal@kernel.org \
--cc=y2038@lists.linaro.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;
as well as URLs for NNTP newsgroup(s).