public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2] aiocp: remove the check read unnecessary flag
Date: Thu, 9 Feb 2023 15:35:40 +0100	[thread overview]
Message-ID: <a4e0b95e-47dd-0c05-9575-a844d1e05953@suse.com> (raw)
In-Reply-To: <20230209142016.494090-1-pifang@redhat.com>

Hi!

Acked-by: Andrea Cervesato <andrea.cervesato@suse.com>

Andrea

On 2/9/23 15:20, Ping Fang wrote:
> When aiocp executed with -f DIRECT will fail.
>
> <<<test_start>>>
> tag=AD049 stime=1675520824
> cmdline="aiocp -b 8k -n 8 -f DIRECT"
> contacts=""
> analysis=exit
> <<<test_output>>>
> tst_test.c:1560: TINFO: Timeout per run is 0h 30m 30s
> aiocp.c:211: TINFO: Maximum AIO blocks: 65536
> tst_device.c:585: TINFO: Use uevent strategy
> aiocp.c:250: TINFO: Fill srcfile.bin with random data
> aiocp.c:279: TINFO: Copy srcfile.bin -> dstfile.bin
> aiocp.c:291: TINFO: Comparing srcfile.bin with dstfile.bin
> aiocp.c:306: TBROK: read(3,0x7ffcd743abe0,4096) failed, returned -1: EINVAL (22)
> ...
>
> The code which checks that the data has been written correctly
> may wrong use the O_DIRECT flag, which may cause a failure like the
> one above.
>
> Signed-off-by: Ping Fang <pifang@redhat.com>
> ---
>   testcases/kernel/io/ltp-aiodio/aiocp.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/testcases/kernel/io/ltp-aiodio/aiocp.c b/testcases/kernel/io/ltp-aiodio/aiocp.c
> index bc0e209b2..6212d8ee8 100644
> --- a/testcases/kernel/io/ltp-aiodio/aiocp.c
> +++ b/testcases/kernel/io/ltp-aiodio/aiocp.c
> @@ -297,8 +297,8 @@ static void run(void)
>   		return;
>   	}
>   
> -	srcfd = SAFE_OPEN(srcname, srcflags | O_RDONLY, 0666);
> -	dstfd = SAFE_OPEN(dstname, srcflags | O_RDONLY, 0666);
> +	srcfd = SAFE_OPEN(srcname, O_RDONLY, 0666);
> +	dstfd = SAFE_OPEN(dstname, O_RDONLY, 0666);
>   
>   	reads = howmany(filesize, buffsize);
>   



-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2023-02-09 14:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 14:20 [LTP] [PATCH v2] aiocp: remove the check read unnecessary flag Ping Fang
2023-02-09 14:24 ` Cyril Hrubis
2023-02-09 14:35 ` Andrea Cervesato via ltp [this message]
2023-02-10  5:27   ` Li Wang
2023-02-10  8:00     ` Li Wang
2023-02-09 14:37 ` Jan Stancek

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=a4e0b95e-47dd-0c05-9575-a844d1e05953@suse.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox