Page MenuHomeFreeBSD

zfs: default zfs_dmu_offset_next_sync to 0 to avoid data corruption
AbandonedPublic

Authored by emaste on Nov 27 2023, 3:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 5, 12:58 PM
Unknown Object (File)
Wed, Oct 2, 8:01 PM
Unknown Object (File)
Wed, Oct 2, 2:37 AM
Unknown Object (File)
Wed, Oct 2, 1:17 AM
Unknown Object (File)
Fri, Sep 27, 4:04 AM
Unknown Object (File)
Sun, Sep 22, 3:28 AM
Unknown Object (File)
Sat, Sep 21, 10:01 AM
Unknown Object (File)
Sep 15 2024, 10:00 PM
Subscribers

Details

Reviewers
mm
allanjude
Group Reviewers
ZFS
releng
Summary
This greatly reduces the probability of encountering a data corruption
issue.

From zfs(4), zfs_dmu_offset_next_sync's description:

    Enable forcing TXG sync to find holes.  When enabled forces ZFS
    to sync data when SEEK_HOLE or SEEK_DATA flags are used allowing
    holes in a file to be accurately reported.  When disabled holes
    will not be reported in recently dirtied files.

See https://github.com/openzfs/zfs/issues/15526 for more details.

Sponsored by:   The FreeBSD Foundation

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

It may reduce probability, but it does not fix the problem, plus it makes lseek() to lie, that may or may not be good, depending on situation. I don't think this worth extra activity right now if https://github.com/openzfs/zfs/pull/15571, hopefully fixing the issue, land next days.

I think lseek missing holes isn't that big of a concern given that's the mode we operated in for a very long time, but I agree it looks like 15571 is close to landing and now agree we should just bring that in when ready.