Subject: Re: linux-next: boottime warning from todays linux-next

From: Luis Chamberlain <[email-masked]>
Date: Thu, 10 Feb 2022 15:19:09 -0800

On Thu, Feb 10, 2022 at 10:29:53PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> On Thu, 10 Feb 2022 21:41:25 +1100 Stephen Rothwell <[email-masked]> wrote:
> >
> > On Thu, 10 Feb 2022 19:33:02 +1100 Stephen Rothwell <[email-masked]> wrote:
> > >
> > > On Thu, 10 Feb 2022 18:43:40 +1100 Stephen Rothwell <[email-masked]> wrote:  
> > > >
> > > > My qemu boot of a powerpc pseries_le_defconfig kernel produced these
> > > > kernel messages:
> > > > 
> > > >   CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.17.0-rc3 #2
> > > >   Call Trace:
> > > >   [c0000000073e3a80] [c0000000007bfd40] dump_stack_lvl+0x74/0xa8 (unreliable)
> > > >   [c0000000073e3ac0] [c00000000057e3dc] __register_sysctl_table+0x60c/0x9f0
> > > >   [c0000000073e3bd0] [c000000002041170] init_fs_stat_sysctls+0x48/0x60
> > > >   [c0000000073e3bf0] [c000000000012110] do_one_initcall+0x60/0x2d0
> > > >   [c0000000073e3cd0] [c0000000020049f0] kernel_init_freeable+0x334/0x3dc
> > > >   [c0000000073e3db0] [c000000000012710] kernel_init+0x30/0x1a0
> > > >   [c0000000073e3e10] [c00000000000cd64] ret_from_kernel_thread+0x5c/0x64
> > > > 
> > > > Presumably introduced by commit
> > > > 
> > > >   b42bc9a3c511 ("Fix regression due to "fs: move binfmt_misc sysctl to its own file"")    
> > > 
> > > OK, I cannot reproduce this with just Linus' tree.  I will try to bisect.  

OK so that's not the issue.

> > It bisected to commit
> > 
> >   43a9443d5da2 ("Merge branch 'akpm-current/current'")
> > 
> > and both parents of that commit are fine :-(

FWIW Linus merged a more newer version of the regression fix, and only
until today did we get that version on linux-next.

> So it seems that the parent of "fs/binfmt_misc" is a permanently empty
> directory - the is_empty_dir() check in insert_header() succeeds.

I am not seeing this issue on x86_64 KVM guest with:

CONFIG_BINFMT_MISC=m
or
CONFIG_BINFMT_MISC=y

I think the issue might be that linux-next has Andrew's earlier
version of the fix merged, and Linus now has the new version. So
linux-next has these extra things below. But I can't understand
why this is seen on ppc and not on x86_64.

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 241cfc6bc36f..788b9a34d5ab 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2735,17 +2735,6 @@ static struct ctl_table vm_table[] = {
 	{ }
 };
 
-static struct ctl_table fs_table[] = {
-#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
-	{
-		.procname	= "binfmt_misc",
-		.mode		= 0555,
-		.child		= sysctl_mount_point,
-	},
-#endif
-	{ }
-};
-
 static struct ctl_table debug_table[] = {
 #ifdef CONFIG_SYSCTL_EXCEPTION_TRACE
 	{
@@ -2765,7 +2754,6 @@ static struct ctl_table dev_table[] = {
 
 DECLARE_SYSCTL_BASE(kernel, kern_table);
 DECLARE_SYSCTL_BASE(vm, vm_table);
-DECLARE_SYSCTL_BASE(fs, fs_table);
 DECLARE_SYSCTL_BASE(debug, debug_table);
 DECLARE_SYSCTL_BASE(dev, dev_table);
 
@@ -2773,7 +2761,6 @@ int __init sysctl_init_bases(void)
 {
 	register_sysctl_base(kernel);
 	register_sysctl_base(vm);
-	register_sysctl_base(fs);
 	register_sysctl_base(debug);
 	register_sysctl_base(dev);