HomeFreeBSD

vfs: fix freevnodes count update race against preemption

Description

vfs: fix freevnodes count update race against preemption

vdbatch_process leaves the critical section too early, openign a time
window where another thread can get scheduled and modify vd->freevnodes.
Once it the preempted thread gets back it overrides the value with 0.

Just move critical_exit to the end of the function.

Details

Provenance
mjgAuthored on
Parents
rS357129: ufs: add vgone calls for unconstructed vnodes in the error path
Branches
Unknown
Tags
Unknown