Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1087841rwb; Fri, 28 Jul 2023 04:45:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlHYnyk54d9iz6QHXIWINnIJA664nfzSqz54Y5sweCtdMm/JnogN5W974iMdP2Ry486ACIru X-Received: by 2002:a17:906:7788:b0:991:f28c:54ea with SMTP id s8-20020a170906778800b00991f28c54eamr1989711ejm.41.1690544704770; Fri, 28 Jul 2023 04:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690544704; cv=none; d=google.com; s=arc-20160816; b=wiR5ad3eCU3RmbuH6QYy+n/Bd77y0hAgX2/p10gSWE1cvz4Bm5u6Evkazwi2G3GKNb 4ubajtaJZqzj1AO0ERTAzez2U0XtnWq7RvIg7LyMDfyKmJQVxAwSGDgYaAr4xOwdDplS gvYNI1m5lyvXBP0QVBddegD/jRiY/SSg/FHBA9KC78RujjKvZfnrZPxUW0ot2kD3EgtE /FqPRT8caWHwb/+5x7iAdtBvuMHmkbtoLx2EVJI6DQ+pujy6fMbHqQUYCDRhPhpVlOgM r3bAJ8M9iYlyPonJfHOY5qG2yg4Ae1PaMphABdkCR8vR9VkTfWP/0rkQRbpC/fRgk9DU 18Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dQNcnPGvgNIjAateOGHBisyuI149IkxlNcysv/C85/Q=; fh=pk1H4/mReNTcQNmGhBeqH5RRxZFNg3INK2FxfkUQgdg=; b=LNIInD+hOc5c9TNGZN8EzTNqqt+8sHFfh/VGbDt64CDVJOFnfyIBB0MAE36oVTiewI Wtow7+YMpSX2eQehH6d5VxsV8LZO23vkhFILA9E2QJU63w5gRFBEW6PqZOJzGbYm0SSI yG7qTRL/7W1kfZQ6+0HDXeWGKqu3lgDp/MF0Av4BUTlLBXOpkD/yyZ8wZjJl9VgcwcrT z7dZCMmQxXjfdyTrJtjkRDO3NXy1wxYrZrGJJvfn3RGJ4UbM11Pyy1CRXTsDfV5USZI/ 0oh+8XoxraNfATeAQxiuhY+zGOL2sI2xbDJm2YFxJqP+1kcfdFVmL8fwiqb6XnWOHn8K 6eXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XOd/EpcN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ci18-20020a170906c35200b009932d8a227asi2633656ejb.277.2023.07.28.04.44.39; Fri, 28 Jul 2023 04:45:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="XOd/EpcN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235646AbjG1Ksm (ORCPT + 99 others); Fri, 28 Jul 2023 06:48:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234180AbjG1Ksi (ORCPT ); Fri, 28 Jul 2023 06:48:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FED919B6; Fri, 28 Jul 2023 03:48:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C16C6620DE; Fri, 28 Jul 2023 10:48:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C3E6C433C8; Fri, 28 Jul 2023 10:48:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690541316; bh=Ua3Nq6ErGR02ZKzEq2FJx72D5cYGNbW8Cmy7BoDjPAQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XOd/EpcNBPP/niX953VLgFzat1P9RgReSHB0gx9zv7anYC1NXoaSfcQdlzVeqdCR8 JVOa4fRN9P5JtI6eCeoc+FRe+kv+Z26K8nGA3pgbvK3Z2Rmvzn858CSR7LadVUbGKS s2XDXRzQr+9itqFp0Uw5UWtVM7OLEufWypIVwuf+EiE4NfdkTFKUKPHzbWnTTnFgso 8mgYiWqpqqk5UokkEopcp2VhXRtHg3SvOE0kmZWeuiUtI0ifIYUST8dlreFfQVOaIE UoxSlDmHW/zI5FyYfSUDrpQSLgRo5mgRo6e6GNDhL/mAvT1gQpYH9XCnn5D7LxzyyF Nmi3B0FJA5v3w== Date: Fri, 28 Jul 2023 12:48:31 +0200 From: Simon Horman To: Joel Granados Cc: mcgrof@kernel.org, Kees Cook , Iurii Zaikin , willy@infradead.org, josh@joshtriplett.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 03/14] sysctl: Add ctl_table_size to ctl_table_header Message-ID: References: <20230726140635.2059334-1-j.granados@samsung.com> <20230726140635.2059334-4-j.granados@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230726140635.2059334-4-j.granados@samsung.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 26, 2023 at 04:06:23PM +0200, Joel Granados wrote: > The new ctl_table_size element will hold the size of the ctl_table > contained in the header. This value is passed by the callers to the > sysctl register infrastructure. > > This is a preparation commit that allows us to systematically add > ctl_table_size and start using it only when it is in all the places > where there is a sysctl registration. > > Signed-off-by: Joel Granados > --- > include/linux/sysctl.h | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h > index 59d451f455bf..33252ad58ebe 100644 > --- a/include/linux/sysctl.h > +++ b/include/linux/sysctl.h > @@ -159,12 +159,22 @@ struct ctl_node { > struct ctl_table_header *header; > }; > > -/* struct ctl_table_header is used to maintain dynamic lists of > - struct ctl_table trees. */ > +/** > + * struct ctl_table_header - maintains dynamic lists of struct ctl_table trees > + * @ctl_table: pointer to the first element in ctl_table array > + * @ctl_table_size: number of elements pointed by @ctl_table > + * @used: The entry will never be touched when equal to 0. > + * @count: Upped every time something is added to @inodes and downed every time > + * something is removed from inodes > + * @nreg: When nreg drops to 0 the ctl_table_header will be unregistered. > + * @rcu: Delays the freeing of the inode. Introduced with "unfuck proc_sysctl ->d_compare()" > + * > + */ Please consider documenting all fields of struct ctl_table_header. ./scripts/kernel-doc complains that the following are missing: unregistering ctl_table_arg root set parent node inodes