shutdown: unmount filesystems after swapoff Swap on file requires operational underlying mount, otherwise swapoff_all() is guaranteed to panic due to the default strategy VOP for reclaimed vnodes.
swapoff_one(): only check free pages count manually turning swap off When swap is turned off due to system shutdown or reboot, ignore the check. Problem is that the check is not accurate by any means, free page count can legitimately be low while system still able to page in everything from the swap. Then, we turn swap off if swapping on real file or some non-standard geom provider, and typically panic when system appears to actually need to unavailable page. For syscall, it is better to be safe than sorry.
Reported and tested by: peterj