svn commit: r365643 - head/bin/cp

Warner Losh imp at bsdimp.com
Sat Sep 26 18:54:54 UTC 2020


On Sat, Sep 26, 2020 at 11:02 AM Rodney W. Grimes <freebsd at gndrsh.dnsmgr.net>
wrote:

>
> > On Fri, 2020-09-25 at 10:55 -0700, Rodney W. Grimes wrote:
> > > > I was under the impression from previous reading and kib's response
> > > > that this is a complete non-issue, there's no way you can go
> > > > multi-user without a mounted /dev and we go to somewhat great
> > > > lengths to make sure we're good.
> > >
> > > Though kib can assert that, it does not change the fact that I
> > > frequently find /dev/null FILES on unmounted root file systems.
> > >
> > > But lets not mix the 2 separate things of boot time /dev dependency
> > > and build time /dev dependency.
> >
> > If you look in sys/kern/vfs_mountroot.c you can see that the code to
> > mount /dev is invoked unconditionally as the first step of mounting
> > root, and that all the calls it makes to get devfs mounted have their
> > results checked with KASSERTs.
> >
> > That's pretty strong evidence that devfs is mounted before rc scripts
> > run.  That creates a situation where you are making an extraordinary
> > claim, so you need to provide extraordinary evidence to support it.  A
> > sequence of actions that allows others to recreate the situation would
> > do the trick.
>
> I have provided ways one can look for this file in
> other messages of the threads.  A dump of a UFS root
> can show it up, and iirc you can find it in a
> zfs send of a boot dataset.
>

You've not provided a step-by-step way to recreate the issue leading to the
/dev/null file, however. Absent that, it's going to be really hard to fix
it.

> (A question that occurs to me:  could it be that the files you've seen
> > got created at shutdown after devfs was unmounted, rather than at
> > startup?  I don't know enough about the shutdown sequence to know
> > whether that's possible.)
>
> Its not "the files" it is "a file, /dev/null".  And yes, it could
> be very possible that it is during shutdown.  Sadly the files is
> usually of 0 length so leave little clue as to what is creating them.
>

And there's the rub: how did this file come to exist? I'm certain it isn't
booting or shutting down the system based on when devfs is mounted (before
init) and unmounted (it's not done by the shutdown scripts). Now, it's
always possible there's a hole in my understanding of the sequence of
events. But given the examination of code, it's crazy to think this could
be created by anything but some weird bug. That's why a step-by-step from
scratch guide is needed. Im happy to look into it, but I need a bit more to
go on.

Warner


More information about the svn-src-head mailing list