Page MenuHomeFreeBSD

ufs: add O_DSYNC support
Needs ReviewPublic

Authored by tmunro on Jun 5 2020, 10:15 PM.



Building on top of D25090, here is an attempt to teach UFS to recognise O_DSYNC.

However... there is something I don't understand. I used my test program at to exercise the various syncing methods. Starting with an empty file "rm -f test_file && touch test_file", and then observing the I/O behaviour with "dtrace -n 'io:::start { @[stack()] = count(); }'" I found that neither "sync --fdatasync --append test_file" nor "sync --o-dsync --append test_file" ever reaches I/O via the ffs_update() path, but "sync --fsync --append test_file" and "sync --o-sync --append test_file" do. That is what I expected when using the "--overwrite" mode (no need for inode update), but not when using the "--append" mode of the test. Will keep looking...

Diff Detail

Lint Skipped
Unit Tests Skipped

Event Timeline

tmunro requested review of this revision.Jun 5 2020, 10:15 PM
tmunro created this revision.
kib added a comment.Jun 23 2020, 4:14 AM

I am not sure what you see in dtrace, but I see a bug in ffs_write() regardless of IO_DATASYNC. D25404