mirror of
https://github.com/versity/scoutfs.git
synced 2026-07-26 18:13:01 +00:00
The vfs often calls filesystem methods with i_mutex held. This creates a natural ordering of i_mutex outside of cluster locks. The file aio_read method acquired i_mutex after its cluster lock, creating a deadlock with other vfs methods like setattr. The acquisition of i_mutex after the cluster lock was due to using the pattern where we use the per-task lock to discover if we're the first user of the lock in a call chain. Readpage has to do this, but file aio_read doesn't. It should never be called recursively. So we can acquire the i_mutex outside of the cluster lock and warn if we ever are called recursively. Signed-off-by: Zach Brown <zab@versity.com>