Page MenuHomeFreeBSD

Revert vn_write behavior difference

Authored by on Jun 2 2021, 12:38 PM.



Starting on 5/20, OpenZFS encountered a behavior change in which one of the tests in the test suite began failing 100% of the time on the buildbot which runs 14-CURRENT snapshots, which was not improved by rolling back to earlier revisions of OpenZFS.

One kernel bisect later, ca1ce50b2b5ef11d85841f3aead98b2a9ad18819 is the winner; a few rounds of reverting individual hunks pointed to the one touched in this patch as changing the behavior.

Noticed that the aforementioned commit changed the effective behavior from if (A || B) { set flag } to if (A && B) { set flag }, and that didn't seem to be necessary for the goals stated in the commit; restructured it to return the if (A || B) behavior, confirmed the test case now passes as expected.

Diff Detail

rG FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline created this revision.

Huh, this is a brainfart on my end. Thanks for the patch.

This revision is now accepted and ready to land.Jun 2 2021, 12:57 PM

What exact author line would you like to be credited with? As in what should show up as 'Author:' when someone git log's?

I'm going to tweak the commit message, roughly this:

vfs: fix MNT_SYNCHRONOUS check in vn_write

ca1ce50b2b5ef11d ("vfs: add more safety against concurrent forced
unmount to vn_write") has a side effect of only checking MNT_SYNCHRONOUS
if O_FSYNC is set.

Reviewed By: mjg
Differential Revision:

and wrap one long line to this:

mp = atomic_load_ptr(&vp->v_mount);
 if ((fp->f_flag & O_FSYNC) ||
     (mp != NULL && (mp->mnt_flag & MNT_SYNCHRONOUS)))
         ioflag |= IO_SYNC;

My usual Author field is "Rich Ercolani <>", so I'd go with that.

With mjg@'s suggested changes

Reviewed By: allanjude

This revision was automatically updated to reflect the committed changes.