Page MenuHomeFreeBSD

swap on file: fix locking
ClosedPublic

Authored by kib on Nov 25 2021, 5:29 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 6 2024, 10:32 PM
Unknown Object (File)
Oct 9 2024, 12:35 AM
Unknown Object (File)
Oct 6 2024, 4:46 PM
Unknown Object (File)
Oct 6 2024, 4:24 AM
Unknown Object (File)
Oct 3 2024, 6:01 AM
Unknown Object (File)
Oct 2 2024, 9:44 PM
Unknown Object (File)
Oct 1 2024, 9:29 AM
Unknown Object (File)
Sep 25 2024, 2:12 PM
Subscribers

Details

Summary
swap pager: lock vnode around VOP_CLOSE()
swapon: extend the region where the swap vnode is locked

to cover VOP_GETATTR() call in sys_swapon().  Move locking from inside
swapongeom() and swaponvp() into sys_swapon().
swap_pager: lock vnode in swapdev_strategy()

VOP_STRATEGY() requires locked vnode.  Note that we lock the swap vnode
while pages are busy, but this would only cause real LoR if pages belong
to the swap vnode, which must not be the case for correct use.

Reported and tested by: peterj

Diff Detail

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