<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Petr,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 25, 2020 at 2:55 AM Petr Vorel <<a href="mailto:pvorel@suse.cz">pvorel@suse.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Cyril,<br>
<br>
> > > Also if we are going to add this functionality it should be added as an<br>
> > > .needs_cmds array in the tst_test structure.<br>
> > .needs_cmds sounds as a good idea. But let's do it as a separate effort.<br>
> > I'll leave already sent v2 for review. Once .needs_cmds is implemented, we can<br>
> > use it as well for copy_file_range02.c.<br>
<br>
> Actually I would like to avoid exposing the function to the tests and<br>
> force people to use the .needs_cmds instead in order to have a proper<br>
> metadata.<br>
Oh yes, metadata effort, that's important, I'll implement it. But I still think<br>
it's useful to have <span class="gmail_default" style="font-size:small"></span>SAFE_RUNCMD(), although I can remove TCONF (use flag<br>
TST_RUN_CMD_CHECK_CMD, see below).<br></blockquote><div> </div><div><span class="gmail_default" style="font-size:small"></span>I'm OK with <span class="gmail_default" style="font-size:small"></span><span class="gmail_default"></span>SAFE_RUNCMD<span class="gmail_default" style="font-size:small"></span><span class="gmail_default" style="font-size:small">.</span></div><div></div><div><span class="gmail_default"></span> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> > BTW what do you think on changing 255 (and 254) for something less common?<br>
> > It's just a corner case swapon on certain setup in copy_file_range02.c returns<br>
> > 255 on error:<br>
<br>
> I do not think that this will solve the problem. We may hit the same<br>
> problem with any random number we will choose.<br>
<br>
> I guess checking for the command existence before we vfork() would be<br>
> safer bet here.<br>
+1. But this IMHO requires to add another parameter to tst_run_cmd_fds_(),<br>
because we don't want always TCONF. Best will be to turn int pass_exit_val into<br>
int flags with 2 possible values (e.g. TST_RUN_CMD_PASS_EXIT_VAL and<br>
<span class="gmail_default" style="font-size:small"></span>TST_RUN_CMD_CHECK_CMD).<br></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">Agree, if we set '.needs_cmds' already we don't need to double-check the command existence in tst_run_cmd() again.</div></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>