[Bug 272678] VFS: Incorrect data in read from concurrent write

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 23 Jul 2023 15:43:48 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272678

Mateusz Guzik <mjg@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjg@FreeBSD.org

--- Comment #4 from Mateusz Guzik <mjg@FreeBSD.org> ---
Thanks for the report.

Analysis looks mostly right.

Until the issue is resolved, it can be worked around with:
sysctl debug.vn_io_pgcache_read_enable=0 (which you can add to sysctl.conf)

To the bug, while it is correct that the size is updated first and causing
trouble, another issue is that pages are only sbusied (as opposed to xbusied),
thus even if file size remains unchanged, the read may get a transient state
which violates the idea of reads and writes maintaining atomicity.

truncate should also xbusy, which will sort it out.

-- 
You are receiving this mail because:
You are the assignee for the bug.