From owner-dev-commits-src-main@freebsd.org Sun Aug 22 14:18:55 2021 Return-Path: Delivered-To: dev-commits-src-main@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 DE3BB655E52; Sun, 22 Aug 2021 14:18:55 +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 4GsyCy6dcvz3NMk; Sun, 22 Aug 2021 14:18:54 +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 17MEIigW062337 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 22 Aug 2021 17:18:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 17MEIigW062337 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 17MEIi0J062336; Sun, 22 Aug 2021 17:18:44 +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:18:44 +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: 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: 4GsyCy6dcvz3NMk X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [1.22 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-0.46)[-0.456]; TO_DN_SOME(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; NEURAL_SPAM_MEDIUM(0.98)[0.976]; NEURAL_SPAM_SHORT(0.70)[0.702]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2021 14:18:55 -0000 On Sun, Aug 22, 2021 at 05:15:22PM +0300, Konstantin Belousov wrote: > 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. No, I was wrong and the commit as is is right, assuming that the intent is to interpose libc symbols with librt functionality. Of course this is very fragile and would not work if e.g. librt is loaded after libc is linked in and symbols resolved. I fixed this (mostly) for libthr, but librt is not. > > > + > > 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()); > > }