public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] readahead02.c fixes: use tst_parse_filesize() so that we can pass sizes with units e.g. -s 128M
@ 2023-01-09  5:12 coolgw
  2023-01-10  9:16 ` Petr Vorel
  0 siblings, 1 reply; 10+ messages in thread
From: coolgw @ 2023-01-09  5:12 UTC (permalink / raw)
  To: ltp

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);
 		tst_set_max_runtime(1 + testfile_size / (DEFAULT_FILESIZE/32));
 	}
 
-- 
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2023-01-18  3:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-09  5:12 [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  9:16 ` Petr Vorel
2023-01-15 23:47   ` [LTP] [PATCH v2] readahead02.c: Fix check input fsize Wei Gao via ltp
2023-01-16  8:48     ` [LTP] [PATCH v3] " Wei Gao via ltp
2023-01-16 11:17       ` [LTP] [PATCH v4] " Wei Gao via ltp
2023-01-16 13:42         ` Cyril Hrubis
2023-01-18  3:36           ` Wei Gao via ltp
2023-01-18  3:44         ` [LTP] [PATCH v5] " Wei Gao via ltp
2023-01-16 12:55       ` [LTP] [PATCH v3] " Cyril Hrubis
2023-01-16 10:29     ` [LTP] [PATCH v2] " Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox