Does sync(8) really flush everything? Lost writes with journaled SU after sync+power cycle

Kevin Day toasty at dragondata.com
Tue Apr 16 11:50:19 UTC 2013


On Apr 11, 2013, at 1:30 AM, Bruce Evans <brde at optusnet.com.au> wrote:
> sync(2) only schedules all writing of all modified buffers to disk.  Its
> man page even says this.  It doesn't wait for any of the writes to complete.

A very kind person has pointed out to me (off-list) that doing:

mount -u -o ro /

(without -f)

causes mount to force a flush, waits for completion, THEN bails out because there are open files preventing the read-only downgrade. We've been testing this here and it seems to be a usable workaround.

I'm also pointing out for at least our purposes, this problem (sync(2) doesn't seem to actually cause any writes) only seems to be causing lost directories if I'm using journaling. I'm attempting to narrow down why journaling appears to make sync into a no-op. 

-- Kevin



More information about the freebsd-fs mailing list