Re: NFS v4 and async writes
jon wayne wrote:[color=blue]
> I had the following doubts, could someone clear them please?
> linux - 2.6 or above
> nfs - v4
> 1.Does a fwrite on a file opened with O_SYNC block until the data is
> actually written by the server on the
> 2.In case I open a file without using the O_SYNC option and do an fsync
> after all the writes are thru, will
> a positive response mean that the data is actually copied to disk
> from the buffers on the server side??
The short answer to both questions is "yes, usually". It's not clear
whether you're using Linux 2.6 as clients or servers or both. So I
won't make any assumptions there.
To qualify the "usually", here're a few ways you can lose your data
1. The server may not be NFS compliant. I doubt that Windows NFS (SFU)
sync to disk immediately, for example.
2. Linux servers may turn off synchronous writes with the "async"
3. Even hard disks have write cache. Having written to "disk" doesn't
mean it's on
Cases (1) and (2) may be under your control, on what kind of server to
use and how to configure it. I wouldn't worry about case (3) too much,
unless your app is super mission critical. In that case, I'd use a
dedicated NAS appliance.