xfs: fix mmap_sem/iolock inversion in xfs_free_eofblocks
authorChristoph Hellwig <hch@infradead.org>
Mon, 19 Oct 2009 04:03:46 +0000 (04:03 +0000)
committerAlex Elder <aelder@sgi.com>
Fri, 11 Dec 2009 21:11:19 +0000 (15:11 -0600)
When xfs_free_eofblocks is called from ->release the VM might already
hold the mmap_sem, but in the write path we take the iolock before
taking the mmap_sem in the generic write code.

Switch xfs_free_eofblocks to only trylock the iolock if called from
->release and skip trimming the prellocated blocks in that case.
We'll still free them later on the final iput.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Signed-off-by: Alex Elder <aelder@sgi.com>

No differences found