|Summary:||nfsclient does not fall back to v2 synchronous mode when using O_SYNC|
|Product:||File System||Reporter:||Stefan Bader (stefan.bader)|
|Component:||NFS||Assignee:||Trond Myklebust (trondmy)|
|Kernel Version:||2.6.32 to 2.6.38-rc3||Subsystem:|
Description Stefan Bader 2011-02-07 15:38:18 UTC
Comment 1 Stefan Bader 2011-02-08 13:46:19 UTC
To add a little detail here: I slightly modified the test case to write out 100 blocks in sequence. The strace on both kernel versions (2.6.32 based and 2.6.38 based) only show read and writes (no fsync or sync). The tcpdump however shows, again in both cases, that every write (with UNSTABLE flag) is followed by a COMMIT. This sounds to me, that from a data integrity point of view, the result is the same as one would expect. That is every write is waited for before continuing with the next write. The only downside I could see is that instead of using one write request with the FILE_SYNC flag, this requires two requests for each write which seems a bit of a waste. And it seems unexpected compared to the documentation of O_SYNC I found at http://www.faqs.org/docs/Linux-HOWTO/NFS-HOWTO.html#MOUNTOPTIONS in section 5.9.
Comment 2 Trond Myklebust 2011-04-15 21:30:06 UTC
This should be fixed in the upstream kernel with commit b31268ac793fd300da66b9c28bbf0a200339ab96 (FS: Use stable writes when not doing a bulk flush). Please reopen this bug if the above commit doesn't fix the problem.