From 812176832169c77b4bacddd01edc3e55340263fd Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Mon, 4 Aug 2014 13:29:32 +1000 Subject: [PATCH] xfs: fix swapext ilock deadlock xfs_swap_extents() holds the ilock over a call to filemap_write_and_wait(), which can then try to write data and take the ilock. That causes a self-deadlock. Fix the deadlock and clean up the code by separating the locking appropriately. Add a lockflags variable to track what locks we are holding as we gain and drop them and cleanup the error handling to always use "out_unlock" with the lockflags variable. Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- Reading git-format-patch failed