Le jeudi 09 octobre 2008 à 12:00 -0500, Anthony Liguori a écrit :
[...]
So to summarize, I think we should enable O_DSYNC by default to
ensure
that guest data integrity is not dependent on the host OS, and that
practically speaking, cache=off is only useful for very specialized
circumstances. Part of the patch I'll follow up with includes
changes
to the man page to document all of this for users.
perhaps I'm wrong but I think O_DSYNC (in fact O_SYNC for linux) will
impact host filesystem performance, at least with ext3, because the
synchronicity is done through the commit of the journal of the whole
filesystem:
see fs/ext3/file.c:ext3_file_write() (I've removed the comments here) :
...
if (file->f_flags & O_SYNC) {
if (!ext3_should_journal_data(inode))
return ret;
goto force_commit;
}
if (!IS_SYNC(inode))
return ret;
force_commit:
err = ext3_force_commit(inode->i_sb);
if (err)
return err;
return ret;
}
Moreover, the real behavior depends on the type of the journaling system
you use...
Regards,
Laurent