Subject: Re: FFS update doesn't sync metadata?
To: None <tech-kern@NetBSD.org>
From: David Young <dyoung@pobox.com>
List: tech-kern
Date: 12/23/2004 01:10:09
On Wed, Dec 22, 2004 at 10:18:23PM -0600, David Young wrote:
> On Mon, Dec 06, 2004 at 02:22:51PM -0600, Frederick Bruckman wrote:
> > On Mon, 6 Dec 2004, Jaromir Dolecek wrote:
> > 
> > >Frederick Bruckman wrote:
> > >
> > >>the intuitive thing would be to flush the buffer cache *after* the
> > >>filesystem is marked "rw", if that's possible.
> > 
> > Actually, I meant to say "ro" there. I guess you got that.
> > 
> > >Yeah, the intuitive thing would be to flush the buffer cache
> > >after filesystem is marked ro. Is there any reason we don't
> > >do that? AFAICS ffs only flushes file system data on update to 'ro',
> > >but not metadata.
> > 
> > Perhaps that code path simply hasn't been adapted to soft updates. 
> > There didn't used to be any metadata in the buffer cache, ever.
> 
> Is there an easy fix or workaround for this?
> 
> I'm afraid my Soekris boxes are badly affected by this bug.  I have an
> app on Soekris boards that does mount -u -w /, writes some configuration
> files, and does mount -u -r /.  Sometimes the app reboots the box directly
> after.  The last file created is oftentimes truncated to 0 after reboot.
> 
> Other data points:
> 
>         1 sometimes the box is unresponsive for several seconds
>           after i type 'reboot'; sometimes it prints 'syncing disks 3
>           3 3 3 3 3 3 3 ...' before the BIOS boot starts

Here the box was taking several seconds to reboot, so I entered ddb with
a BREAK---what's going on here?

  # reboot
  ~Stopped at      netbsd:cpu_Debugger+0x4:        popl    %ebp
  db> trace/u
  cpu_Debugger(4,0,c01748d0,c0359e9c,800) at netbsd:cpu_Debugger+0x4
  comintr(c04ca400,0,c0350010,30,c0350010) at netbsd:comintr+0xcd
  Xintr_legacy4() at netbsd:Xintr_legacy4+0xa9
  --- interrupt ---
  cpu_switch(c030fca0,0,1,0,0) at netbsd:cpu_switch+0x9f
  ltsleep(c030fae0,4,c02a6e79,0,0) at netbsd:ltsleep+0x234
  uvm_scheduler(c030fac0,1,c0355008,355000,35c000) at netbsd:uvm_scheduler+0x76
  setrootfstime(0,0,0,0,0) at netbsd:setrootfstime
  db> continue
  syncing disks... 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 giving up
  rebooting...


Dave

-- 
David Young             OJC Technologies
dyoung@ojctech.com      Urbana, IL * (217) 278-3933