Page MenuHomeFreeBSD

Revert vn_write behavior difference
ClosedPublic

Authored by rincebrain_gmail.com on Jun 2 2021, 12:38 PM.
Tags
None
Referenced Files
F81994364: D30610.diff
Wed, Apr 24, 7:17 AM
Unknown Object (File)
Mar 12 2024, 3:33 AM
Unknown Object (File)
Feb 10 2024, 5:17 PM
Unknown Object (File)
Jan 26 2024, 10:48 AM
Unknown Object (File)
Jan 19 2024, 9:09 PM
Unknown Object (File)
Dec 24 2023, 8:56 AM
Unknown Object (File)
Dec 20 2023, 4:22 AM
Unknown Object (File)
Dec 12 2023, 10:50 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.