mirror of
https://github.com/versity/scoutfs.git
synced 2026-04-23 23:10:31 +00:00
Lock teardown during unmount involves first calling shutdown and then destroy. The shutdown call is meant to ensure that it's safe to tear down the client network connections. Once shutdown returns locking is promising that it won't call into the client to send new lock requests. The current shutdown implementation is very heavy handed and shuts down everything. This creates a deadlock. After calling lock shutdown, the client will send its farewell and wait for a response. The server might not send the farewell response until other mounts have unmounted if our client is in the server's mount. In this case we stil have to be processing lock invalidation requests to allow other unmounting clients to make forward progress. This is reasonably easy and safe to do. We only use the shutdown flag to stop lock calls that would change lock state and send requests. We don't have it stop incoming requests processing in the work queueing functions. It's safe to keep processing incoming requests between _shutdown and _destroy because the requests already come in through the client. As the client shuts down it will stop calling us. Signed-off-by: Zach Brown <zab@versity.com>