Skip to contentSkip to conversation

Does Linux sync(2) wait?

DISCUSSION Frank Cusack 1 participant 1 message Mar 21, 2004

lore
Share & tools
lore
#0 lore raw

Looking at 2.4 and 2.6 sources, Linux does appear to wait before returning. I'm especially interested if NFS data is sent to the server. (I want to be able to take a stable snapshot of a netapp volume.)

But on my RHL 9 system, I have 3 different man pages and an info page, all of which say something different.

sync(2) says:

According to the standard specification (e.g., SVID), sync() schedules the writes, but may return before the actual writing is done. However, since version 1.3.20 Linux does actually wait.

sync(8) says:

On Linux, sync is only guaranteed to schedule the dirty blocks for writing; it can actually take a short time before all the blocks are finally written.

sync(1) is in the middle and doesn't really say anything, it refers to the info page which also isn't specific.

/fc