From: Amir Goldstein <amir73il@gmail.com>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it, Jan Stancek <jstancek@redhat.com>,
Miklos Szeredi <miklos@szeredi.hu>,
linux-unionfs@vger.kernel.org
Subject: [PATCH v3 6/6] syscalls/readahead02: fail test if readahead did not use any cache
Date: Thu, 11 Oct 2018 02:34:41 +0300 [thread overview]
Message-ID: <20181010233441.5337-7-amir73il@gmail.com> (raw)
In-Reply-To: <20181010233441.5337-1-amir73il@gmail.com>
The heuristic of failing the test only if not saving any io has false
negatives with overlayfs readahead() bug, but readahead() with overlayfs
always warns on "using less cache then expected", when actually, it is
using no cache at all.
Add another condition to fail the test if readahead did not use any
cache at all, which always detected the overlayfs bug.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Acked-by: Jan Stancek <jstancek@redhat.com>
---
testcases/kernel/syscalls/readahead/readahead02.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/testcases/kernel/syscalls/readahead/readahead02.c b/testcases/kernel/syscalls/readahead/readahead02.c
index d5cc7677b..657461905 100644
--- a/testcases/kernel/syscalls/readahead/readahead02.c
+++ b/testcases/kernel/syscalls/readahead/readahead02.c
@@ -346,6 +346,8 @@ static void test_readahead(unsigned int n)
*/
if (cached_ra * 1024 > testfile_size / 2)
tst_res(TPASS, "using cache as expected");
+ else if (!cached_ra)
+ tst_res(TFAIL, "readahead failed to use any cache");
else
tst_res(TWARN, "using less cache than expected");
} else {
--
2.17.1
next prev parent reply other threads:[~2018-10-10 23:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-10 23:34 [PATCH v3 0/6] Tests for readahead() and fadvise() on overlayfs Amir Goldstein
2018-10-10 23:34 ` [PATCH v3 1/6] syscalls/readahead01: Convert to newlib Amir Goldstein
2018-11-02 15:34 ` Cyril Hrubis
2018-10-10 23:34 ` [PATCH v3 2/6] syscalls/readahead02: Convert to newlib and cleanup Amir Goldstein
2018-11-20 16:07 ` Cyril Hrubis
2018-11-20 16:42 ` [LTP] " Cyril Hrubis
2018-11-28 16:50 ` Amir Goldstein
2018-10-10 23:34 ` [PATCH v3 3/6] syscalls/readahead02: abort test if readahead syscall fails Amir Goldstein
2018-11-20 16:30 ` Cyril Hrubis
2018-11-28 9:52 ` Amir Goldstein
2018-10-10 23:34 ` [PATCH v3 4/6] syscalls/readahead02: test readahead() on an overlayfs file Amir Goldstein
2018-10-10 23:34 ` [PATCH v3 5/6] syscalls/readahead02: test readahead using posix_fadvise() Amir Goldstein
2018-10-10 23:34 ` Amir Goldstein [this message]
2018-11-02 10:32 ` [PATCH v3 0/6] Tests for readahead() and fadvise() on overlayfs Amir Goldstein
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=20181010233441.5337-7-amir73il@gmail.com \
--to=amir73il@gmail.com \
--cc=chrubis@suse.cz \
--cc=jstancek@redhat.com \
--cc=linux-unionfs@vger.kernel.org \
--cc=ltp@lists.linux.it \
--cc=miklos@szeredi.hu \
/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).