[LTP] [PATCH v3 15/16] fs/fs_fill: Add a test to fill a FS in a few threads

Li Wang liwang@redhat.com
Thu Nov 9 11:43:40 CET 2017


On Thu, Nov 9, 2017 at 6:19 PM, Cyril Hrubis <chrubis@suse.cz> wrote:
> 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.

Actually yes. Retest and failed again.

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

The broken are not only in tst_fills_fs() function but also come from
SAFE_MKDIR(w->dir, 0700),
SAFE_OPENDIR(w->dir) and SAFE_UNLINK(file).

   safe_macros.c:169: BROK: fs_fill.c:49:
mkdir(mntpoint/thread21,0700) failed: ENOSPC

If we just handle the 'ENOSPC' in tst_fill_fs(), I doubt that test
will be broken as well.


-- 
Li Wang
liwang@redhat.com


More information about the ltp mailing list