From nobody Wed Mar 1 15:28:07 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PRdRN35d9z3v06l; Wed, 1 Mar 2023 15:28:16 +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 4PRdRM708Qz3QSB; Wed, 1 Mar 2023 15:28:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.17.1/8.17.1) with ESMTPS id 321FS7NZ063020 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 1 Mar 2023 17:28:11 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 321FS7NZ063020 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 321FS713063019; Wed, 1 Mar 2023 17:28:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 1 Mar 2023 17:28:07 +0200 From: Konstantin Belousov To: John Baldwin Cc: Mateusz Guzik , markj@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 68912701700c - main - ffs_suspend.c: clean up includes Message-ID: References: <202212292056.2BTKuOIu047460@gitrepo.freebsd.org> <8ceb993e-1589-fd24-1786-4438acb9a07f@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ceb993e-1589-fd24-1786-4438acb9a07f@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=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4PRdRM708Qz3QSB X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On Tue, Feb 28, 2023 at 10:55:41AM -0800, John Baldwin wrote: > On 1/3/23 3:53 AM, Konstantin Belousov wrote: > > On Mon, Jan 02, 2023 at 06:29:57PM +0100, Mateusz Guzik wrote: > > > On 12/29/22, Konstantin Belousov wrote: > > > > The branch main has been updated by kib: > > > > > > > > URL: > > > > https://cgit.FreeBSD.org/src/commit/?id=68912701700ca3230f3e2d4b7858a038f884a327 > > > > > > > > commit 68912701700ca3230f3e2d4b7858a038f884a327 > > > > Author: Konstantin Belousov > > > > AuthorDate: 2022-12-28 18:17:53 +0000 > > > > Commit: Konstantin Belousov > > > > CommitDate: 2022-12-29 20:55:39 +0000 > > > > > > > > ffs_suspend.c: clean up includes > > > > > > > > Order includes alphabetically. > > > > Remove unneeded sys/param.h, it is already included by sys/systm.h. > > > > > > > > Reviewed by: mckusick > > > > Sponsored by: The FreeBSD Foundation > > > > MFC after: 1 week > > > > Differential revision: https://reviews.freebsd.org/D37896 > > > > --- > > > > sys/ufs/ffs/ffs_suspend.c | 7 +++---- > > > > 1 file changed, 3 insertions(+), 4 deletions(-) > > > > > > > > diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c > > > > index d13097109758..e7c976b6e921 100644 > > > > --- a/sys/ufs/ffs/ffs_suspend.c > > > > +++ b/sys/ufs/ffs/ffs_suspend.c > > > > @@ -33,15 +33,14 @@ > > > > #include > > > > __FBSDID("$FreeBSD$"); > > > > > > > > -#include > > > > #include > > > > #include > > > > -#include > > > > -#include > > > > -#include > > > > #include > > > > +#include > > > > #include > > > > +#include > > > > #include > > > > +#include > > > > > > > > #include > > > > > > > > > > > > > > tinderbox fails the KCSAN et al kernels: > > > > > > In file included from /usr/src/sys/ufs/ffs/ffs_suspend.c:36: > > > In file included from /usr/src/sys/sys/systm.h:44: > > > In file included from ./machine/atomic.h:73: > > > /usr/src/sys/sys/atomic_san.h:117:24: error: unknown type name 'uint8_t' > > > ATOMIC_SAN_FUNCS(char, uint8_t); > > > ^ > > > it bisects to this commit > > > > > So the problem is that sys/systm.h includes machine/atomic.h which always > > had the pre-requisite sys/types.h, and this is documented in atomic(9). > > But sys/atomic_san.h uses C89 types in prototypes, not just macros, and > > this breaks for real. > > > > I can > > 1. Just add sys/types.h to ufs_suspend.c (I prefer not) > > 2. Add sys/types.h to sys/atomic_san.h. > > 3. Add sys/types.h to sys/systm.h. > > > > IMO #2 is not the best solution, since it pollutes systm.h only sometimes, > > when the right kernel options are used. I would prefer #3, it seems, but > > want to ensure that there is a consensus about the addition to sys/systm.h. > > FYI, I got a different ream of breakages downstream in CheriBSD due to this > commit removing param.h as well. I also only ever recalled Bruce telling me > to do either or first (and only one of them). > I don't recall any special rules for . > > CheriBSD has a local diff that tries to sort headers in systm.h which is why > we get larger breakage: > > --- a/sys/sys/systm.h > +++ b/sys/sys/systm.h > @@ -41,13 +41,22 @@ > #define _SYS_SYSTM_H_ > #include > -#include > -#include > #include > #include > #include > #include /* for people using printf mainly */ > +#include > +#include > > I think if we want to be self-contained we should swap > for . I think moving the includes down would also be > more consistent with style(9) as well. I do not have any objections about both suggested changes. IMO direct use of sys/cdefs.h should be minimized, esp. since we no longer require svn tag.