[LTP] [PATCH 2/2] Use SAFE_RUNCMD()

Cyril Hrubis chrubis@suse.cz
Wed Mar 25 02:53:25 CET 2020


Hi!
> > Also if we are going to add this functionality it should be added as an
> > .needs_cmds array in the tst_test structure.
> .needs_cmds sounds as a good idea. But let's do it as a separate effort.
> I'll leave already sent v2 for review. Once .needs_cmds is implemented, we can
> use it as well for copy_file_range02.c.

Actually I would like to avoid exposing the function to the tests and
force people to use the .needs_cmds instead in order to have a proper
metadata.

> BTW what do you think on changing 255 (and 254) for something less common?
> It's just a corner case swapon on certain setup in copy_file_range02.c returns
> 255 on error:

I do not think that this will solve the problem. We may hit the same
problem with any random number we will choose.

I guess checking for the command existence before we vfork() would be
safer bet here.

> Setting up swapspace version 1, size = 36 KiB (36864 bytes)
> no label, UUID=bae78639-be0b-42b2-9e91-815b05f5751b
> swapon: /tmp/msT4Ch/file_swap: swapon failed: Invalid argument
> copy_file_range02.c:95: CONF: swapon binary not installed or failed
> 
> Kind regards,
> Petr

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list