Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2002 16:58:03 +0100
From:      Rahul Siddharthan <rsidd@online.fr>
To:        hackers@freebsd.org
Subject:   Re: Again Softupdates on 4.5
Message-ID:  <20020131165803.C6390@lpt.ens.fr>
In-Reply-To: <200201311332.g0VDWvb01491@beerswilling.netscum.dyndns.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
> > > > Does 4.5 also leave write-caching on by default?  If so, I think
> > > > that's a terrible mistake.  Would I be correct in assuming it's
> > > > way to late to get this reconsidered?
> > >
> > > Yes, write-cache is enabled by default on 4.5 (as it was on 4.4).
> > >
> > > The debate on this has been long and often mis-informed. There is
> > > a real risk of metadata corruption with write caching and
> > > softupdates, but it appears to be EXTREMELY small. So far no case
> > > of it has actually been confirmed.

It happened to me yesterday, for the first time ever on FreeBSD.  The
system was 4.5-RC1, and the kernel was patched to include a USB audio
driver, and at some time it panicked with a page fault.  Upon reboot
the automatic fsck did not succeed.  I had to do a manual fsck and
there were major inconsistencies, and at the end many files in the
/usr filesystem went missing.  (No real disaster, I just had to
reinstall the base system eventually.)  I don't think it had anything
to do with softupdates, because the / partition also did not fsck
automatically, and that didn't have softupdates enabled.  I've had
crashes/freezes before which didn't mess up the file system, but this
crash happened twice yesterday with that USB audio driver, and both
times the file system was messed up.

After that I turned write caching off.  I had one more panic, but no
disasters -- the automatic fsck worked.  Maybe it's just me but I
don't really notice a slowing down with write caching off (softupdates
is still on). 

> > If I enabled softupdates + write cache and then I do
> >
> > cd /some-big-directory
> > rm -r *
> > shutdown -p now
> >
> > then the file system will be corrupted on reboot.

I haven't seen this; I'm pretty sure I've shutdown the system soon
after doing large rm -r * operations, though admittedly not while the
rm -r was actually going on.

> And, I'm just guessing here, only because the delay before poweroff
> isn't quite enough for the disk's write cache to drain.  Just like
> if you were to yank out the power cord after giving the `shutdown -p'
> (poweroff) command.

With a clean software shutdown, doesn't the shutdown sync the disk
before powering it off, and doesn't the hardware take care of flushing
the disk's write cache before the poweroff -- at any rate isn't it
supposed to?  Seems quite different from yanking out the power cord to
me.

- Rahul

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020131165803.C6390>