[Bug 206328] Crash on shutdown with swap on NFS file (with patch)

Gary Jennejohn gljennjohn at gmail.com
Mon Jan 18 15:48:31 UTC 2016


On Mon, 18 Jan 2016 13:15:22 +0100
"Ronald Klop" <ronald-lists at klop.ws> wrote:

> On Mon, 18 Jan 2016 10:48:10 +0100, <bugzilla-noreply at freebsd.org> wrote:
> 
> > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206328
> >
> > --- Comment #3 from Tom Vijlbrief <tvijlbrief at gmail.com> ---
> > bufshutdown() ends with:
> >
> >
> >                 if (panicstr == NULL)
> >                         vfs_unmountall();
> >         }
> >         swapoff_all();
> >
> > Why not just reverse the order?
> >
> > So swapoff_all() before the vfs_unmountall(), so that the NFS filesystem  
> > is
> > still available.
> >
> > Perhaps even at the start of bufshutdown().
> >
> > Still wondering what the reason of a swapoff_all() call just before the  
> > actual
> > reboot is.
> >  
> 
> Maybe... leaving swap on a mirrored disk will give a rebuild of the mirror  
> on boot if swap is not swapped off.
>

Right, eventually swapgeom_close() gets called to clean things up.

Still, it seems rather strange that all the swapped out pages are
paged back in when the utlimate goal is to close the swap devices
cleanly.  Of course, there is some logic in the code to handle the
case where some process(es) may be actively swapping while the kernel
is shutting things down.

-- 
Gary Jennejohn


More information about the freebsd-fs mailing list