Page MenuHomeFreeBSD

swap on file: fix locking
ClosedPublic

Authored by kib on Thu, Nov 25, 5:29 PM.

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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.