[LTP] [PATCH v3 15/16] fs/fs_fill: Add a test to fill a FS in a few threads
Cyril Hrubis
chrubis@suse.cz
Thu Nov 9 11:19:15 CET 2017
Hi!
> This case always broken in SAFE_* operations, seems the reason is no
> space left on the device,
> so I wonder if is it necessary to create so many thread "CPUs + 2" to
> run the test?
>
> What about just creating half of CPU number thread (nthreads =
> tst_ncpus_conf()/2 + 1) there?
>
> $ git diff
> diff --git a/testcases/kernel/fs/fs_fill/fs_fill.c
> b/testcases/kernel/fs/fs_fill/fs_fill.c
> index a50a22f..13207c4 100644
> --- a/testcases/kernel/fs/fs_fill/fs_fill.c
> +++ b/testcases/kernel/fs/fs_fill/fs_fill.c
> @@ -106,7 +106,7 @@ static void testrun(void)
>
> static void setup(void)
> {
> - nthreads = tst_ncpus_conf() + 2;
> + nthreads = tst_ncpus_conf()/2 + 1;
>
> tst_res(TINFO, "Running %i writer threads", nthreads);
> }
This does not fix the problem, only makes it less likely.
The correct fix is to use open() instead of SAFE_OPEN() in the
tst_fill_fs() and just return from the function when we get ENOSPC. I
can fix that, or you can send the patch. Either way thanks for pointing
out the mistake.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list