linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/5] syscalls/readahead02: fail test if readahead did not use any cache
@ 2018-09-29  9:44 Amir Goldstein
  2018-10-03 12:50 ` [LTP] " Jan Stancek
  0 siblings, 1 reply; 2+ messages in thread
From: Amir Goldstein @ 2018-09-29  9:44 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp, Miklos Szeredi, linux-unionfs

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>
---

Cyril,

This is a followup for the overlayfs readahead series.
With the patches already posted, the test fails sometimes, but
most of the times it just gets a warning.

With this additional patch test fails reliably.
Note that test only fails between these upstream commits:
  good  b833a3660394 ("ovl: add ovl_fadvise()")
  bad   5b910bd615ba ("ovl: fix GPF in swapfile_activate...")

I have a few more minor fixes for the v2 series, but I will hold
them back until v1 is reviewed.

Thanks,
Amir.

 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 b497fb5db..fbcae1df8 100644
--- a/testcases/kernel/syscalls/readahead/readahead02.c
+++ b/testcases/kernel/syscalls/readahead/readahead02.c
@@ -341,6 +341,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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH 5/5] syscalls/readahead02: fail test if readahead did not use any cache
  2018-09-29  9:44 [PATCH 5/5] syscalls/readahead02: fail test if readahead did not use any cache Amir Goldstein
@ 2018-10-03 12:50 ` Jan Stancek
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Stancek @ 2018-10-03 12:50 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: Cyril Hrubis, linux-unionfs, ltp, Miklos Szeredi


----- Original Message -----
> 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.

ack, explicit FAIL here looks reasonable

> 
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
> 
> Cyril,
> 
> This is a followup for the overlayfs readahead series.
> With the patches already posted, the test fails sometimes, but
> most of the times it just gets a warning.
> 
> With this additional patch test fails reliably.
> Note that test only fails between these upstream commits:
>   good  b833a3660394 ("ovl: add ovl_fadvise()")
>   bad   5b910bd615ba ("ovl: fix GPF in swapfile_activate...")
> 
> I have a few more minor fixes for the v2 series, but I will hold
> them back until v1 is reviewed.
> 
> Thanks,
> Amir.
> 
>  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 b497fb5db..fbcae1df8 100644
> --- a/testcases/kernel/syscalls/readahead/readahead02.c
> +++ b/testcases/kernel/syscalls/readahead/readahead02.c
> @@ -341,6 +341,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
> 
> 
> --
> Mailing list info: https://lists.linux.it/listinfo/ltp
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-03 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-29  9:44 [PATCH 5/5] syscalls/readahead02: fail test if readahead did not use any cache Amir Goldstein
2018-10-03 12:50 ` [LTP] " Jan Stancek

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).