On Mon, Aug 15, 2011 at 01:59:39PM +0200, Jan Kara wrote:
Why have you chosen to set O_DSYNC?
O_DSYNC was the closest thing to O_DIRECT, in that writes get forced
to disk after the write finished. I did this fix a test failure
caused by missing direct I/O writes with a buffered read. OTOH, there
is a performance cost in doing this since it will force a journal
commit after every write. That's probably not acceptable. Hmph.
Also what about reads? Mixing of buffered writes and direct IO reads will
not work because filemap_write_and_write() does not write data block to the
final location on disk but only to a journal.
Given that, we're probably better off forcing reads drop O_DIRECT as
well and drop O_DSYNC.
I'll change the patch and then give it a test.
- Ted