All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3 3/3] syscalls/pipe2_03: Add new test for pipe2 O_DIRECT flag
Date: Wed, 22 Apr 2020 16:12:54 +0800	[thread overview]
Message-ID: <1f29b873-b256-b475-87c5-83378017aa39@cn.fujitsu.com> (raw)
In-Reply-To: <53bb4ba1-0e68-4abb-39fd-9e661ed38754@cn.fujitsu.com>

Hi Li


> Hi Li
> 
>> Hi Xu,
>>
>> Yang Xu <xuyang2018.jy@cn.fujitsu.com 
>> <mailto:xuyang2018.jy@cn.fujitsu.com>> wrote:
>>
>> ??? ...
>> ???? >
>> ???? > # ./pipe2_03
>> ???? > tst_test.c:1246: INFO: Timeout per run is 0h 05m 00s
>> ???? > pipe2_03.c:48: PASS: Each write(2) uses a separate packet
>> ???? > pipe2_03.c:61: PASS: Each read(2) reads a separate packet
>> ???? > pipe2_03.c:81: PASS: write(higner than PIPE_BUF) split into
>> ??? multiple packet
>> ???? > pipe2_03.c:108: FAIL: the excess bytes in the packet is 
>> discarded by
>> ???? > read, expect 1 got 1%A
>> ??? Even I use one fork and exit(0), I don't meet this problem. Or, I 
>> miss
>> ??? something?
>>
>>
>> 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.
>>
>> -- 
>> Regards,
>> Li Wang
> 
> 
> 



  reply	other threads:[~2020-04-22  8:12 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-10  8:52 [LTP] [PATCH] syscalls/pipe2_01: convert into new API Yang Xu
2020-04-15  5:11 ` [LTP] [PATCH v2] " Yang Xu
2020-04-16  7:28   ` [LTP] [PATCH v3 0/3] increase pipe2 coverage Yang Xu
2020-04-16  7:29     ` [LTP] [PATCH v3 1/3] syscalls/pipe2_01: convert into new API Yang Xu
2020-04-21  8:19       ` Li Wang
2020-04-21  8:27         ` Yang Xu
2020-04-16  7:29     ` [LTP] [PATCH v3 2/3] syscalls/pipe2_02: Add new test for pipe2 O_CLOEXEC flag Yang Xu
2020-04-21  8:49       ` Li Wang
2020-04-21  9:41         ` Yang Xu
2020-04-21  9:59           ` Li Wang
2020-04-16  7:29     ` [LTP] [PATCH v3 3/3] syscalls/pipe2_03: Add new test for pipe2 O_DIRECT flag Yang Xu
2020-04-17  9:44       ` Li Wang
2020-04-17  9:56         ` Yang Xu
2020-04-17 10:13           ` Li Wang
2020-04-17 10:50             ` Li Wang
2020-04-21  9:53       ` Li Wang
2020-04-21 10:21         ` Yang Xu
2020-04-22  6:05           ` Li Wang
2020-04-22  6:14             ` Yang Xu
2020-04-22  7:29           ` Li Wang
2020-04-22  8:08             ` Yang Xu
2020-04-22  8:12               ` Yang Xu [this message]
2020-04-22  9:31                 ` Yang Xu
2020-04-22 10:05                   ` Li Wang
2020-04-22 10:06                     ` Yang Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1f29b873-b256-b475-87c5-83378017aa39@cn.fujitsu.com \
    --to=xuyang2018.jy@cn.fujitsu.com \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.