non-root fixes
cover non-root fixes
1/1 fixes non-root rw tests, and 2/2 makes yet another test case to handle non-root users.
Pavel Begunkov (2):
tests: rw: don't exit ring when init failed
tests: non-root io_uring_register
test/io_uring_register.c | 8 +++++--- test/iopoll.c | 3 +-- test/read-write.c | 4 +--- 3 files changed, 7 insertions(+), 8 deletions(-)
Signature · 1 line
2.32.0
PATCH 1/2 tests: rw: don't exit ring when init failed
Don't do io_uring_queue_exit() after t_create_ring() got skipped.
Signed-off-by Pavel Begunkov <[email protected]>
--- test/iopoll.c | 3 +-- test/read-write.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-)
test/iopoll.c +1 -2
@@ -278,13 +278,12 @@ static int test_io(const char *file, int write, int sqthread, int fixed, ret =t_create_ring (64 , &ring, ring_flags);if (ret ==T_SETUP_SKIP ) - goto done; +return 0 ;if (ret !=T_SETUP_OK ) {fprintf (stderr,"ring create failed: %d\n" , ret);return 1 ; } ret =__test_io (file, &ring, write, sqthread, fixed, buf_select); -done:io_uring_queue_exit (&ring);return ret; }
test/read-write.c +1 -3
@@ -242,7 +242,7 @@ static int test_io(const char *file, int write, int buffered, int sqthread, ret =t_create_ring (64 , &ring, ring_flags);if (ret ==T_SETUP_SKIP ) - goto done; +return 0 ;if (ret !=T_SETUP_OK ) {fprintf (stderr,"ring create failed: %d\n" , ret);return 1 ;
@@ -250,8 +250,6 @@ static int test_io(const char *file, int write, int buffered, int sqthread, ret =__test_io (file, &ring, write, buffered, sqthread, fixed, nonvec,0 ,0 , exp_len); - -done:io_uring_queue_exit (&ring);return ret; }
Signature · 1 line
2.32.0
PATCH 2/2 tests: non-root io_uring_register
In reply to Pavel BegunkovNon-previliged users can't register too many buffers, just skip the test in this case.
Signed-off-by Pavel Begunkov <[email protected]>
--- test/io_uring_register.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
test/io_uring_register.c +5 -3
@@ -303,12 +303,14 @@ test_iovec_nr(int fd)printf ("io_uring_register(%d, %u, %p, %u)\n" , fd,IORING_REGISTER_BUFFERS , iovs, nr); ret =__sys_io_uring_register (fd,IORING_REGISTER_BUFFERS , iovs, nr); -if (ret !=0 ) { +if (ret && (errno ==ENOMEM || errno ==EPERM ) &&geteuid ()) { +printf ("can't register large iovec for regular users, skip\n" ); + }else if (ret !=0 ) {printf ("expected success, got %d\n" , errno); status =1 ; - }else + }else {__sys_io_uring_register (fd,IORING_UNREGISTER_BUFFERS ,0 ,0 ); - + }free (buf);free (iovs);return status;
Signature · 1 line
2.32.0
Quoted 11 lines · Pavel Begunkov
1/1 fixes non-root rw tests, and 2/2 makes yet another test case to handle non-root users.
Pavel Begunkov (2):
tests: rw: don't exit ring when init failed
tests: non-rootio_uring_registertest/io_uring_register.c | 8 +++++--- test/iopoll.c | 3 +-- test/read-write.c | 4 +--- 3 files changed, 7 insertions(+), 8 deletions(-)
Applied, thanks.
Signature · 1 line
Jens Axboe