mirror of
https://github.com/versity/scoutfs.git
synced 2026-07-30 20:13:17 +00:00
scoutfs_item_write_done() acquires the cinf dirty_lock and pg rwlock out of order. It uses a trylock to detect failure and back off of both before retrying. sparse seems to have some peculiar sensitivity to following the else branch from a failed trylock while already in a context. Doing that consistently triggered the spurious mismatched context warning. This refactors the loop to always drop and reacquire the dirty_lock after attemping the trylock. It's not great, but this shouldn't be very contended because the transaction write has serialized write lock holderse that would be trying to dirty items. The silly lock noise will be mostly cached. Signed-off-by: Zach Brown <zab@versity.com>