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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C698C433F5 for ; Fri, 28 Jan 2022 16:49:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350252AbiA1Qtw (ORCPT ); Fri, 28 Jan 2022 11:49:52 -0500 Received: from out01.mta.xmission.com ([166.70.13.231]:42118 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349979AbiA1Qtv (ORCPT ); Fri, 28 Jan 2022 11:49:51 -0500 Received: from in01.mta.xmission.com ([166.70.13.51]:41252) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nDURQ-00AOp3-6z; Fri, 28 Jan 2022 09:49:40 -0700 Received: from ip68-110-24-146.om.om.cox.net ([68.110.24.146]:52112 helo=email.froward.int.ebiederm.org.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nDURO-002fYn-TO; Fri, 28 Jan 2022 09:49:39 -0700 From: "Eric W. Biederman" To: Jan Kara Cc: Linus Torvalds , kernel test robot , Luis Chamberlain , Al Viro , Amir Goldstein , Andy Shevchenko , Antti Palosaari , Arnd Bergmann , Benjamin Herrenschmidt , Benjamin LaHaise , Clemens Ladisch , David Airlie , Greg Kroah-Hartman , Iurii Zaikin , Jani Nikula , Joel Becker , Joonas Lahtinen , Joseph Qi , Julia Lawall , Kees Cook , Lukas Middendorf , Mark Fasheh , Paul Turner , Peter Zijlstra , Petr Mladek , Phillip Potter , Qing Wang , Rodrigo Vivi , Sebastian Reichel , Sergey Senozhatsky , Stephen Kitt , Tetsuo Handa , Xiaoming Ni , Douglas Gilbert , "James E.J. Bottomley" , Jani Nikula , John Ogness , "Martin K. Petersen" , "Rafael J. Wysocki" , Steven Rostedt , Suren Baghdasaryan , Theodore Ts'o , Andrew Morton , LKML , lkp@lists.01.org, kernel test robot References: <20220128065310.GF8421@xsang-OptiPlex-9020> <20220128120421.kzo5iduigr7k55bs@quack3.lan> Date: Fri, 28 Jan 2022 10:49:16 -0600 In-Reply-To: <20220128120421.kzo5iduigr7k55bs@quack3.lan> (Jan Kara's message of "Fri, 28 Jan 2022 13:04:21 +0100") Message-ID: <87a6ffst4j.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1nDURO-002fYn-TO;;;mid=<87a6ffst4j.fsf@email.froward.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.110.24.146;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX18k7LLaaFzdLe4COB/a/JUipd1UliL3IMg= X-SA-Exim-Connect-IP: 68.110.24.146 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [ocfs2] c42ff46f97: sysctl_table_check_failed X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jan Kara writes: > On Fri 28-01-22 10:00:29, Linus Torvalds wrote: >> On Fri, Jan 28, 2022 at 8:53 AM kernel test robot wrote: >> > >> > commit: 46e33fd45a52bf03769906e64d8a8a1ab317777d ("ocfs2: simplify subdirectory >> > registration with register_sysctl()") >> >> Well, it's apparently commit c42ff46f97c1 ("ocfs2: simplify >> subdirectory registration with register_sysctl()") in mainline now. >> >> What worries me a bit is that the commit was auto-generated, and when >> reading the commit message it reads as if it wasn't supposed to cause >> any semantic changes at all. >> >> Is the cause of this that 'nm' is supposed to be a directory, and >> register_sysctl() doesn't handle directories? >> >> I don't know this code at all, should it have been simplified even >> further with something (TOTALLY UNTESTED) like the attached? > > Yep, I've tested the patch and it fixes the failure for me. Feel free to > add: > > Tested-by: Jan Kara > > Also the change makes sense to me as far as I'm reading register_sysctl() > so you can also add: > > Reviewed-by: Jan Kara Yes. There is a register_sysctl_paths that can be used if you want/need the embedded directories. That probably would have been a better choice for an automated conversion. But since this there is only the single file in a single directory register_sysctl() with the full path is perfectly fine in this case. Reviewed-by: "Eric W. Biederman" >> diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c >> index 731558a6f27d..dd77b7aaabf5 100644 >> --- a/fs/ocfs2/stackglue.c >> +++ b/fs/ocfs2/stackglue.c >> @@ -661,17 +661,6 @@ static struct ctl_table ocfs2_nm_table[] = { >> { } >> }; >> >> -static struct ctl_table ocfs2_mod_table[] = { >> - { >> - .procname = "nm", >> - .data = NULL, >> - .maxlen = 0, >> - .mode = 0555, >> - .child = ocfs2_nm_table >> - }, >> - { } >> -}; >> - >> static struct ctl_table_header *ocfs2_table_header; >> >> /* >> @@ -682,7 +671,7 @@ static int __init ocfs2_stack_glue_init(void) >> { >> strcpy(cluster_stack_name, OCFS2_STACK_PLUGIN_O2CB); >> >> - ocfs2_table_header = register_sysctl("fs/ocfs2", ocfs2_mod_table); >> + ocfs2_table_header = register_sysctl("fs/ocfs2/nm", ocfs2_nm_table); >> if (!ocfs2_table_header) { >> printk(KERN_ERR >> "ocfs2 stack glue: unable to register sysctl\n");