Page MenuHomeFreeBSD

vnode read(2)/write(2): acquire rangelock regardless of do_vn_io_fault()
ClosedPublic

Authored by kib on Jul 23 2023, 4:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 13, 4:42 PM
Unknown Object (File)
Thu, Sep 12, 2:15 AM
Unknown Object (File)
Sat, Sep 7, 6:53 AM
Unknown Object (File)
Jul 30 2024, 3:22 PM
Unknown Object (File)
Jul 16 2024, 8:43 AM
Unknown Object (File)
Jul 14 2024, 1:52 AM
Unknown Object (File)
Jul 8 2024, 9:20 PM
Unknown Object (File)
Jul 7 2024, 11:17 PM
Subscribers

Details

Summary
To ensure atomicity of reads against parallel writes and truncates,
vnode lock was not enough at least since introduction of vn_io_fault().
That code only take rangelock when it was possible that vn_read() and
vn_write() could drop the vnode lock.

At least since the introduction of VOP_READ_PGCACHE() which generally
does not lock the vnode at all, rangelocks become required even
for filesystems that do not need vn_io_fault() workaround.  For
instance, tmpfs.

PR:     272678
Analyzed by:    Andrew Gierth  <andrew@tao11.riddles.org.uk>

Diff Detail

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