From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC1B3C4332F for ; Wed, 8 Nov 2023 03:42:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C0EC8D0095; Tue, 7 Nov 2023 22:42:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 070A18D0058; Tue, 7 Nov 2023 22:42:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E52ED8D0096; Tue, 7 Nov 2023 22:42:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id D6EE48D0058 for ; Tue, 7 Nov 2023 22:42:43 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B79BE401C7 for ; Wed, 8 Nov 2023 03:42:43 +0000 (UTC) X-FDA: 81433390206.29.A9059F9 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf16.hostedemail.com (Postfix) with ESMTP id 59E83180006; Wed, 8 Nov 2023 03:42:38 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iWEeWkK0; spf=pass (imf16.hostedemail.com: domain of ebiggers@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=ebiggers@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699414960; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=bBtGOXDwP8DtXJ9yG16F8Y8l7U7l15Oz6qdG+MpsGYs=; b=R5q3IcxK8cOeXNBjEd6+R6RKp5QnFdYAOt+UwVrHwVjRUuEXXQDTu5EcSMvzPrQmObUtPn UZViFsJPmPRLh7pojFC+W+HJWaK9X1xysA66pqFq5Ssd5uLN/6K1a7YNxOwu7O4MovWk36 xfuUgcC9WefXryPHNQN9KhyK6+nhcCM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699414960; a=rsa-sha256; cv=none; b=GAo9H9kWAd3cRHBZlNaMKRmJXvpnHtoeSnuJGnLc+srAJm6pzoqiR//R/s0UKvsHjbiU8i 5FVnqtmi3hnl5cGsNCNHje0XD6r3mnqhIdYPrfWmM3zkOSVhM6LqqWyB1DTijZGcGrYfPw RY1+SWoAVJtDC4enMAe5/tismDPNsxE= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=iWEeWkK0; spf=pass (imf16.hostedemail.com: domain of ebiggers@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=ebiggers@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id DCE3BCE1000; Wed, 8 Nov 2023 03:42:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4D38C433C7; Wed, 8 Nov 2023 03:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699414955; bh=FHJSt6kZtXx4ILd8DGDkhSrjysEg2O+K9F8kVqG0aKU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iWEeWkK0SMRDXg+vLARaKDp4eY6YdEa64mOvnmuTXOWdMjYfWETtJUiPu3qY3Hysk 4LSEpc9dYfkzYX7g+al6cSuLAgDYpKHRP2mup9JRPb9e/5zjchsBgqWnDrbYowWf9o JXJkdsYkju/REM9+kegMkELz/TLUR8XEO8gftnzeUcG4ZPPkXz4HlcwoiX57arxoOR 497OH+iqcR3VxDUMU3A+OR05jPgcI/pWScJ13aPmc7QdGcMKr+TCrdqSlbH3XAXWDw +hlzM/DVqfzlLBER49uo8vk6c6avLr24JVCdZ+gCZ+w6p5P9GNfkudf47jMAr59Ou4 Ltd6ELYpy6t/w== Date: Tue, 7 Nov 2023 19:42:31 -0800 From: Eric Biggers To: j.granados@samsung.com Cc: Luis Chamberlain , willy@infradead.org, josh@joshtriplett.org, Kees Cook , David Howells , Alexander Viro , Christian Brauner , Benjamin LaHaise , Eric Biederman , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Jan Kara , Amir Goldstein , Matthew Bobrowski , Anton Altaparmakov , Namjae Jeon , Mark Fasheh , Joel Becker , Joseph Qi , Iurii Zaikin , "Theodore Y. Ts'o" , Chandan Babu R , "Darrick J. Wong" , Jan Harkes , coda@cs.cmu.edu, linux-cachefs@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-mm@kvack.org, linux-nfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ocfs2-devel@lists.linux.dev, fsverity@lists.linux.dev, linux-xfs@vger.kernel.org, codalist@coda.cs.cmu.edu Subject: Re: [PATCH 2/4] aio: Remove the now superfluous sentinel elements from ctl_table array Message-ID: <20231108034231.GB2482@sol.localdomain> References: <20231107-jag-sysctl_remove_empty_elem_fs-v1-0-7176632fea9f@samsung.com> <20231107-jag-sysctl_remove_empty_elem_fs-v1-2-7176632fea9f@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231107-jag-sysctl_remove_empty_elem_fs-v1-2-7176632fea9f@samsung.com> X-Rspamd-Queue-Id: 59E83180006 X-Rspam-User: X-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dpgqkXNCDO2dSEUw4V+iIP4t4hZDYCCaxQALCOrkkclaoUIaZtSvpZutDreXgjVS2QMErhXg+3Bf+M3ejIxVb7g6in48E4jwF6CGHcqTIu90TVBFjtcOQaR7nVgsdqay8qWT7+a6XYfPUki7rBC5+X+3Ons8HEfxTJRTiXPSBzgY2xVI/iwc+zNU X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Nov 07, 2023 at 02:44:21PM +0100, Joel Granados via B4 Relay wrote: > [PATCH 2/4] aio: Remove the now superfluous sentinel elements from ctl_table array The commit prefix should be "fs:". > Remove sentinel elements ctl_table struct. Special attention was placed in > making sure that an empty directory for fs/verity was created when > CONFIG_FS_VERITY_BUILTIN_SIGNATURES is not defined. In this case we use the > register sysctl call that expects a size. [...] > diff --git a/fs/verity/fsverity_private.h b/fs/verity/fsverity_private.h > index d071a6e32581..8191bf7ad706 100644 > --- a/fs/verity/fsverity_private.h > +++ b/fs/verity/fsverity_private.h > @@ -122,8 +122,8 @@ void __init fsverity_init_info_cache(void); > > /* signature.c */ > > -#ifdef CONFIG_FS_VERITY_BUILTIN_SIGNATURES > extern int fsverity_require_signatures; > +#ifdef CONFIG_FS_VERITY_BUILTIN_SIGNATURES > int fsverity_verify_signature(const struct fsverity_info *vi, > const u8 *signature, size_t sig_size); > > diff --git a/fs/verity/init.c b/fs/verity/init.c > index a29f062f6047..e31045dd4f6c 100644 > --- a/fs/verity/init.c > +++ b/fs/verity/init.c > @@ -13,7 +13,6 @@ > static struct ctl_table_header *fsverity_sysctl_header; > > static struct ctl_table fsverity_sysctl_table[] = { > -#ifdef CONFIG_FS_VERITY_BUILTIN_SIGNATURES > { > .procname = "require_signatures", > .data = &fsverity_require_signatures, > @@ -23,14 +22,17 @@ static struct ctl_table fsverity_sysctl_table[] = { > .extra1 = SYSCTL_ZERO, > .extra2 = SYSCTL_ONE, > }, > -#endif > - { } > }; > > static void __init fsverity_init_sysctl(void) > { > +#ifdef CONFIG_FS_VERITY_BUILTIN_SIGNATURES > fsverity_sysctl_header = register_sysctl("fs/verity", > fsverity_sysctl_table); > +#else > + fsverity_sysctl_header = register_sysctl_sz("fs/verity", > + fsverity_sysctl_table, 0); > +#endif > if (!fsverity_sysctl_header) > panic("fsverity sysctl registration failed"); This does not make sense, and it causes a build error when CONFIG_FS_VERITY=y and CONFIG_FS_VERITY_BUILTIN_SIGNATURES=n. I think all you need to do is delete the sentinel element, the same as everywhere else. I just tested it, and it works fine. BTW, the comments for register_sysctl_sz() and __register_sysctl_table() are outdated, as they still say "A completely 0 filled entry terminates the table." - Eric