Date: Mon, 19 Oct 1998 11:10:55 -0700 From: John Polstra <jdp@polstra.com> To: obrien@NUXI.com Cc: hackers@FreeBSD.ORG Subject: Re: softupdates and sync Message-ID: <199810191810.LAA14424@austin.polstra.com> In-Reply-To: Your message of "Mon, 19 Oct 1998 11:00:57 PDT." <19981019110057.A28374@nuxi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> Correctly me if I'm wrong: if you want to know the point at which > the disks are synced, you need to run it twice, right? > > Reason being the 1st ``sync'' simply kicks off the syncing procedure > and then returns. The 2nd ``sync'' will not return until the > syncing procedure from the 1st ``sync'' has completed. Thus once > the 2nd ``sync'' returns, you know your disk buffers are completely > flushed to disk. I haven't studied the code, but I know what the documentation says. It says, "sync() may return before the buffers are completely flushed." It doesn't say that if you run it a second time, it will make sure that the first sync() has completed. There's no stated guarantee of that kind. I think that whatever historical benefit came from running it three times was strictly derived from the fact that it takes a few seconds to type "sync<CR>" three times. It would work just as well to type: sync echo hi echo hi :-) When unmounting a filesystem, you don't have to run sync at all. Unmounting will automatically write out all the dirty buffers. John -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth 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?199810191810.LAA14424>