Page MenuHomeFreeBSD

vfs: fully hold vnodes in vnlru_free_locked

Authored by mjg on Wed, Sep 4, 6:01 PM.



Currently the code only bumps holdcnt and clears the VI_FREE flag, not performing actual vhold. Since the vnode is still visible elsewhere, a potential new user can find it and incorrectly assume it is properly held. Use vholdl to properly hold the vnode.

The other place recycling (vlrureclaim) does this already. This probably can be hacked to avoid most of the work, but that's for later.

Test Plan

reduced maxvnodes to 20000 and tested with from stress2. constant recycles with no issues.

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mjg created this revision.Wed, Sep 4, 6:01 PM
kib accepted this revision.Wed, Sep 4, 6:43 PM
This revision is now accepted and ready to land.Wed, Sep 4, 6:43 PM
This revision was automatically updated to reflect the committed changes.