Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 2006 11:51:38 -0800
From:      "Kevin Oberman" <oberman@es.net>
To:        Chuck Swiger <cswiger@mac.com>
Cc:        FreeBSD Stable <freebsd-stable@FreeBSD.ORG>
Subject:   Re: Problems unmounting/fssyncking extern UFS filesystem 
Message-ID:  <20061128195138.6B09C45096@ptavv.es.net>
In-Reply-To: Your message of "Tue, 28 Nov 2006 11:36:52 PST." <B3594EAF-0C9F-4FB6-9076-522406A05761@mac.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
--==_Exmh_1164743498_993P
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

> From: Chuck Swiger <cswiger@mac.com>
> Date: Tue, 28 Nov 2006 11:36:52 -0800
> 
> On Nov 27, 2006, at 8:41 AM, Kevin Oberman wrote:
> >> As far as I know, that's not different from calling "sync"
> >> just once.  It might make more sense to put a little sleep
> >> between the sync calls, though.
> >
> > The traditional mantra was
> > sync
> > sync
> > sync
> > and not sync;sync;sync. The reason was timing. By entering the sync
> > command three times as fast as anyone could type, the sync could
> > reliably complete.
> 
> Agreed.  Although I've heard rumors that some systems treated 3 syncs  
> as some sort of special case, but I've never seen anything in code to  
> support the notion.
> 
> > That mantra is about 25 years old, so its validity on modern  
> > hardware is
> > questionable, but the need for a delay is very real. I would suggest
> > something like: sync && sleep 5
> 
> The other choice would be to make sync [or the sync(2) system call,  
> more precisely] blocking, so that it does not return until the buffer  
> cache has been flushed and all dirty pages in VM have been written to  
> disk.

The magic phrase is "buffer cache has been flushed". In the real world
of discs with cache there is no way to be certain when the data is
REALLY on the disc. That is why things get clobbered if the power is
cycled to the disc too soon after syncing and why a sleep (or typing
sync three times) is still a good idea and probably always will be.

Of course, some day all discs may stop lying about when data is written,
but I'll be too busy ducking the flying pig.
-- 
R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman@es.net			Phone: +1 510 486-8634
Key fingerprint:059B 2DDF 031C 9BA3 14A4  EADA 927D EBB3 987B 3751

--==_Exmh_1164743498_993P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)
Comment: Exmh version 2.5 06/03/2002

iD8DBQFFbJNKkn3rs5h7N1ERAg11AKCoNSBxJVOvd+USuYsjgNiVN0dARACeKqw0
/iqb76CG/I8y/IizzL3STjo=
=1P2x
-----END PGP SIGNATURE-----

--==_Exmh_1164743498_993P--



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