From owner-dev-commits-src-all@freebsd.org Sun Aug 22 14:15:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 298D8655D81; Sun, 22 Aug 2021 14:15:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Gsy815tF8z3M5n; Sun, 22 Aug 2021 14:15:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 17MEFDQK061734 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 22 Aug 2021 17:15:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 17MEFDQK061734 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 17MEFDRa061732; Sun, 22 Aug 2021 17:15:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 22 Aug 2021 17:15:13 +0300 From: Konstantin Belousov To: Thomas Munro Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 3904e7966eb3 - main - Fix aio_readv(2), aio_writev(2) with SIGEV_THREAD. Message-ID: References: <202108221216.17MCGCC6079644@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202108221216.17MCGCC6079644@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4Gsy815tF8z3M5n X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 14:15:30 -0000 On Sun, Aug 22, 2021 at 12:16:12PM +0000, Thomas Munro wrote: > The branch main has been updated by tmunro: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3904e7966eb353c636c6aa638a6fdf1489ee514c > > commit 3904e7966eb353c636c6aa638a6fdf1489ee514c > Author: Thomas Munro > AuthorDate: 2021-08-22 11:34:07 +0000 > Commit: Thomas Munro > CommitDate: 2021-08-22 11:49:23 +0000 > > Fix aio_readv(2), aio_writev(2) with SIGEV_THREAD. > > Add missing wrapper code to librt for these new functions so that > SIGEV_THREAD works. Without machinery to convert it to SIGEV_THREAD_ID, > you got EINVAL. > > Reviewed by: asomers > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D31618 > --- > lib/libc/sys/Symbol.map | 2 ++ > lib/librt/Symbol.map | 5 +++++ > lib/librt/aio.c | 18 ++++++++++++++++++ > tests/sys/aio/aio_test.c | 7 +++++++ > 4 files changed, 32 insertions(+) > > diff --git a/lib/libc/sys/Symbol.map b/lib/libc/sys/Symbol.map > index 93fbc947a7e1..764d712958be 100644 > --- a/lib/libc/sys/Symbol.map > +++ b/lib/libc/sys/Symbol.map > @@ -495,10 +495,12 @@ FBSDprivate_1.0 { > __sys_aio_error; > __sys_aio_fsync; > __sys_aio_read; > + __sys_aio_readv; > __sys_aio_return; > __sys_aio_suspend; > __sys_aio_waitcomplete; > __sys_aio_write; > + __sys_aio_writev; > _audit; > __sys_audit; > _auditctl; > diff --git a/lib/librt/Symbol.map b/lib/librt/Symbol.map > index c11b88397afd..b8fde3dd33b8 100644 > --- a/lib/librt/Symbol.map > +++ b/lib/librt/Symbol.map > @@ -31,6 +31,11 @@ FBSD_1.5 { > timer_oshandle_np; > }; > > +FBSD_1.6 { > + aio_readv; > + aio_writev; > +}; This must be FBSD_1.7. > + > FBSDprivate_1.0 { > _mq_open; > _mq_close; > diff --git a/lib/librt/aio.c b/lib/librt/aio.c > index 9c35644ecf3d..8e819a002613 100644 > --- a/lib/librt/aio.c > +++ b/lib/librt/aio.c > @@ -42,7 +42,9 @@ > #include "un-namespace.h" > > __weak_reference(__aio_read, aio_read); > +__weak_reference(__aio_readv, aio_readv); > __weak_reference(__aio_write, aio_write); > +__weak_reference(__aio_writev, aio_writev); > __weak_reference(__aio_return, aio_return); > __weak_reference(__aio_waitcomplete, aio_waitcomplete); > __weak_reference(__aio_fsync, aio_fsync); > @@ -51,7 +53,9 @@ __weak_reference(__lio_listio, lio_listio); > typedef void (*aio_func)(union sigval val, struct aiocb *iocb); > > extern int __sys_aio_read(struct aiocb *iocb); > +extern int __sys_aio_readv(struct aiocb *iocb); > extern int __sys_aio_write(struct aiocb *iocb); > +extern int __sys_aio_writev(struct aiocb *iocb); > extern ssize_t __sys_aio_waitcomplete(struct aiocb **iocbp, struct timespec *timeout); > extern ssize_t __sys_aio_return(struct aiocb *iocb); > extern int __sys_aio_error(struct aiocb *iocb); > @@ -130,6 +134,13 @@ __aio_read(struct aiocb *iocb) > return aio_io(iocb, &__sys_aio_read); > } > > +int > +__aio_readv(struct aiocb *iocb) > +{ > + > + return aio_io(iocb, &__sys_aio_readv); > +} > + > int > __aio_write(struct aiocb *iocb) > { > @@ -137,6 +148,13 @@ __aio_write(struct aiocb *iocb) > return aio_io(iocb, &__sys_aio_write); > } > > +int > +__aio_writev(struct aiocb *iocb) > +{ > + > + return aio_io(iocb, &__sys_aio_writev); > +} > + > ssize_t > __aio_waitcomplete(struct aiocb **iocbp, struct timespec *timeout) > { > diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c > index 35bd5dc1264b..1c694ad0c18b 100644 > --- a/tests/sys/aio/aio_test.c > +++ b/tests/sys/aio/aio_test.c > @@ -1627,6 +1627,12 @@ ATF_TC_BODY(vectored_file_poll, tc) > aio_file_test(poll, NULL, true); > } > > +ATF_TC_WITHOUT_HEAD(vectored_thread); > +ATF_TC_BODY(vectored_thread, tc) > +{ > + aio_file_test(poll_signaled, setup_thread(), true); > +} > + > ATF_TC_WITH_CLEANUP(vectored_md_poll); > ATF_TC_HEAD(vectored_md_poll, tc) > { > @@ -1814,6 +1820,7 @@ ATF_TP_ADD_TCS(tp) > ATF_TP_ADD_TC(tp, vectored_zvol_poll); > ATF_TP_ADD_TC(tp, vectored_unaligned); > ATF_TP_ADD_TC(tp, vectored_socket_poll); > + ATF_TP_ADD_TC(tp, vectored_thread); > > return (atf_no_error()); > }