[LTP] [PATCH] migrate_pages02: check file exist before opening it

Li Wang liwang@redhat.com
Mon Mar 7 02:09:51 CET 2022


On Mon, Mar 7, 2022 at 2:51 AM Jan Stancek <jstancek@redhat.com> wrote:

> > +               "?NUMA_BALANCING",
> You probably meant "?"NUMA_BALANCING
>

I guess both should be fine.
(tried locally with original patch and works well)


>
> >
> > Maybe we just need to enhance the .save_restore with another parameter;
> > a value to set the knob to if it does exists, so in add_key05.c it would
> > look like:
> >
> > struct tst_path_val {
> >         const char *path;
> >         const char *val;
> > };
> >
> >         .save_restore = (const struct tst_path_val const[]) {
> >                 {"?/proc/sys/kernel/keys/gc_delay", "1"},
> >                 {"?/proc/sys/kernel/keys/maxkeys", "200"},
> >                 {"?/proc/sys/kernel/keys/maxbytes", "20000"}
> >                 NULL,
> >         },
> >
> > And in cases we do not need to set value we would just pass NULL as
> val...
>

+1



>
> That should work for most testcases, I don't recall one where we need
> to cycle through more values.
>

Agree, even we have that requirement in the future, pass NULL at the
beginning
and reset it via FILE_PRINTF for more cycle values that should be working.
Thanks for the suggestions, I will get start work on V2.

-- 
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220307/afbfbe74/attachment.htm>


More information about the ltp mailing list