From: Richard Palethorpe <rpalethorpe@suse.de>
To: coolgw <coolgw1126@gmail.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] readahead02.c fixes: use tst_parse_filesize() so that we can pass sizes with units e.g. -s 128M
Date: Tue, 10 Jan 2023 10:01:25 +0000 [thread overview]
Message-ID: <87zgaqhe2p.fsf@suse.de> (raw)
In-Reply-To: <20230109032700.7959-1-wegao@suse.com>
Hello,
coolgw <coolgw1126@gmail.com> writes:
> Signed-off-by: WEI GAO <wegao@suse.com>
> ---
> testcases/kernel/syscalls/readahead/readahead02.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/readahead/readahead02.c b/testcases/kernel/syscalls/readahead/readahead02.c
> index 3ed88c005..c282b4d68 100644
> --- a/testcases/kernel/syscalls/readahead/readahead02.c
> +++ b/testcases/kernel/syscalls/readahead/readahead02.c
> @@ -367,8 +367,8 @@ static void setup_readahead_length(void)
>
> static void setup(void)
> {
> - if (opt_fsizestr) {
> - testfile_size = SAFE_STRTOL(opt_fsizestr, 1, INT_MAX);
> + if (tst_parse_filesize(opt_fsizestr, &testfile_size, 1, INT_MAX)) {
> + tst_brk(TBROK, "invalid initial filesize '%s'", opt_fsizestr);
So far correct; if parsing fails we call tst_brk which redirects to cleanup.
> tst_set_max_runtime(1 + testfile_size / (DEFAULT_FILESIZE/32));
However this will never be called because it is on the error path.
The time which we give the test to execute is proportional to the file
size (if the size is non-default!). If it were not then large file sizes
would cause timeouts (possibly at random) which would result in
regressions.
Also note that in the existing test we only use tst_set_max_runtime when
the value is non default. This is a mistake, but luckily the
test.max_runtime = 30 and the calculated runtime for the default size
would be 33. So you are not likely to cause a regression by changing
this.
Setting to changes requested in patchwork.
> }
>
> --
> 2.35.3
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-01-10 10:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 3:27 [LTP] [PATCH v1] readahead02.c fixes: use tst_parse_filesize() so that we can pass sizes with units e.g. -s 128M coolgw
2023-01-10 10:01 ` Richard Palethorpe [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-01-09 3:28 coolgw
2023-01-09 5:06 coolgw
2023-01-09 5:12 coolgw
2023-01-10 9:16 ` Petr Vorel
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=87zgaqhe2p.fsf@suse.de \
--to=rpalethorpe@suse.de \
--cc=coolgw1126@gmail.com \
--cc=ltp@lists.linux.it \
/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