mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 03:00:44 +00:00
Locks get a bast call from the dlm when a remote node is blocked waiting for the mode of a lock to change. We'd set the mode that we need to convert to and kick off lock work to make forward progress. The bast calls can happen at any old time. If a call came in as we were unlocking a lock we'd set its bast mode even though it was being unlocked and would not need to be down converted. Usually this bad mode would be fine because the lock was idle and would just be freed after being locked. But if someone was actively waiting for the lock it would get stuck in an unlocked state. The bad bast mode would prevent it from being upconverted, but the waiters would stop it from being freed. We fix this by only setting the mode from the bast call if there is really work to do. This avoids setting the bast for unlocked locks which will let the lock state machine re-acquire them and make forward progress on behalf of the waiters. Signed-off-by: Zach Brown <zab@versity.com>