diff mbox series

open_posix_testsuite/lio_listio/2-1: increase number of requests

Message ID bd1156e573b0ea8bbf1feeee2cc2b5f84953c1ae.1638192701.git.jstancek@redhat.com
State Accepted, archived
Headers show
Series open_posix_testsuite/lio_listio/2-1: increase number of requests | expand

Commit Message

Jan Stancek Nov. 29, 2021, 1:32 p.m. UTC
Some systems appear to be able to complete all requests before
test checks 'received_all':
  conformance/interfaces/lio_listio/lio_listio_2-1: execution: FAILED: Output:
  lio_listio/2-1.c Error lio_listio() waited for list completion

Increase number of requests, and also make test use different
file offset for each.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 .../conformance/interfaces/lio_listio/2-1.c                   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Cyril Hrubis Nov. 29, 2021, 2:15 p.m. UTC | #1
Hi!
> -#define NUM_AIOCBS	10
> +#define NUM_AIOCBS	256
>  #define BUF_SIZE	1024
>  
>  static volatile int received_selected;
> @@ -98,7 +98,7 @@ int main(void)
>  		memset(aiocbs[i], 0, sizeof(struct aiocb));
>  
>  		aiocbs[i]->aio_fildes = fd;
> -		aiocbs[i]->aio_offset = 0;
> +		aiocbs[i]->aio_offset = i * BUF_SIZE;

The only concern I have is that if the filesystem does not support
sparse files this will eat up 256MB right?

>  		aiocbs[i]->aio_buf = &bufs[i * BUF_SIZE];
>  		aiocbs[i]->aio_nbytes = BUF_SIZE;
>  		aiocbs[i]->aio_lio_opcode = LIO_WRITE;
Cyril Hrubis Nov. 29, 2021, 2:23 p.m. UTC | #2
Hi!
> >  static volatile int received_selected;
> > @@ -98,7 +98,7 @@ int main(void)
> >  		memset(aiocbs[i], 0, sizeof(struct aiocb));
> >  
> >  		aiocbs[i]->aio_fildes = fd;
> > -		aiocbs[i]->aio_offset = 0;
> > +		aiocbs[i]->aio_offset = i * BUF_SIZE;
> 
> The only concern I have is that if the filesystem does not support
> sparse files this will eat up 256MB right?

Ah, it's the same file, that means that it will be just 256kB, that is
fine. Well it would be better to unlink() the file at the end of the
test, but regardless:

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Jan Stancek Nov. 29, 2021, 2:23 p.m. UTC | #3
On Mon, Nov 29, 2021 at 3:21 PM Cyril Hrubis <chrubis@suse.cz> wrote:
>
> Hi!
> > >  static volatile int received_selected;
> > > @@ -98,7 +98,7 @@ int main(void)
> > >             memset(aiocbs[i], 0, sizeof(struct aiocb));
> > >
> > >             aiocbs[i]->aio_fildes = fd;
> > > -           aiocbs[i]->aio_offset = 0;
> > > +           aiocbs[i]->aio_offset = i * BUF_SIZE;
> >
> > The only concern I have is that if the filesystem does not support
> > sparse files this will eat up 256MB right?
>
> Ah, it's the same file, that means that it will be just 256kB, that is
> fine. Well it would be better to unlink() the file at the end of the
> test, but regardless:

Yes, should be only 256kB.

>
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

Thanks, pushed.

>
> --
> Cyril Hrubis
> chrubis@suse.cz
>
diff mbox series

Patch

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c
index 4f458a06bdaf..72a1113e06a3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/lio_listio/2-1.c
@@ -34,7 +34,7 @@ 
 
 #define TNAME "lio_listio/2-1.c"
 
-#define NUM_AIOCBS	10
+#define NUM_AIOCBS	256
 #define BUF_SIZE	1024
 
 static volatile int received_selected;
@@ -98,7 +98,7 @@  int main(void)
 		memset(aiocbs[i], 0, sizeof(struct aiocb));
 
 		aiocbs[i]->aio_fildes = fd;
-		aiocbs[i]->aio_offset = 0;
+		aiocbs[i]->aio_offset = i * BUF_SIZE;
 		aiocbs[i]->aio_buf = &bufs[i * BUF_SIZE];
 		aiocbs[i]->aio_nbytes = BUF_SIZE;
 		aiocbs[i]->aio_lio_opcode = LIO_WRITE;