[LTP] [PATCH v3 3/3] syscalls/pipe2_03: Add new test for pipe2 O_DIRECT flag

Yang Xu xuyang2018.jy@cn.fujitsu.com
Wed Apr 22 12:06:47 CEST 2020


Hi Li

在 2020/04/22 18:05, Li Wang 写道:
> 
> 
> On Wed, Apr 22, 2020 at 5:31 PM Yang Xu <xuyang2018.jy@cn.fujitsu.com 
> <mailto:xuyang2018.jy@cn.fujitsu.com>> wrote:
> 
>     ...
>      >>> I think I got the point.
>      >>>
>      >>> In your test code for pipe2(), you didn't use pipe in the correct
>      >>> way. Even that we define the fds[2] as a global variable, there
>     still
>      >>> have a new copy for fds[2] in the child process, we should
>     close one
>      >>> of the pipes in child and parent to make the connection is built
>      >>> correspondingly, then that will work normally for us.
>      >>>
>      >>> I suggest redesigning some of the test structs. What do you think?
>      >> Yes.
>      >>>
>      >>> Fyi:
>      >>>
>     https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/pipe/pipe02.c
> 
>      >
>      > BTW, pipe02.c can use SAFE_PIPE macro and remove  UCLINUX ifdef.
>      >>>
>      >> In principle, we should use the following format
>      >> step1      pipe(fds);
>      >> step2      SAFE_FORK();
>      >>        child process
>      >> step3         close one fd and do something
>      >>        parent process
>      >> step4         close another fd and do something
>      >>
>      >> Also, we should not do write opeartion in step 1~2, otherwise child
>      >> process will inherit data.
>     modify this case ,url as below:
>     https://github.com/xuyang0410/ltp/commit/6e701803b39123b5abf74bd292c36fee73b54065
> 
>     How about it?
> 
> 
> I leave comment in your patch in github. Thanks for the quick fix, the 
> rest LGTM.
> 
> Can you rebase the code on the latest master and format V4 patch to ML?
OK. I will send a v4 about this patchset.
> 
> -- 
> Regards,
> Li Wang




More information about the ltp mailing list