hook_stack_notify_unregister can leave stack locked
Review Request #1268 — Created Nov. 2, 2018 and submitted
Upstream of Joyent OS-7318. If the nethook framework tries to unregister a notification that's not there (e.g. it's already been removed), it leaves the nethook instance locked preventing things like zone shutdowns from occurring.
This was discovered as part of adding ipf support to viona devices on SmartOS. Some of the SmartOS vmadm firewall tests would result in zones stuck during shutdown (with the stacks showing they were waiting on the nethook lock). Once the fix was applied this stopped occurring and the tests completed successfully.