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 |
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;
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>
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 --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;
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(-)