Page MenuHomeFreeBSD

Revert vn_write behavior difference
ClosedPublic

Authored by rincebrain_gmail.com on Jun 2 2021, 12:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 31, 2:07 PM
Unknown Object (File)
Tue, Oct 22, 11:49 PM
Unknown Object (File)
Sun, Oct 13, 3:50 AM
Unknown Object (File)
Sun, Oct 13, 2:08 AM
Unknown Object (File)
Sat, Oct 12, 10:51 PM
Unknown Object (File)
Sun, Oct 6, 4:49 PM
Unknown Object (File)
Sun, Oct 6, 3:37 PM
Unknown Object (File)
Oct 4 2024, 9:58 PM
Subscribers
None

Details

Summary

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

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rincebrain_gmail.com 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: https://reviews.freebsd.org/D30610

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 <rincebrain@gmail.com>", so I'd go with that.

With mjg@'s suggested changes

Reviewed By: allanjude

This revision was automatically updated to reflect the committed changes.