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)
Tue, Jan 28, 1:09 PM
Unknown Object (File)
Sat, Jan 25, 7:48 PM
Unknown Object (File)
Fri, Jan 24, 7:17 PM
Unknown Object (File)
Wed, Jan 15, 9:44 AM
Unknown Object (File)
Wed, Jan 15, 9:16 AM
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
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