xfs: fix deadlock in xfs_rtfree_extent
authorKamal Dasu <kdasu.kdev@gmail.com>
Thu, 23 Feb 2012 00:41:39 +0000 (00:41 +0000)
committerBen Myers <bpm@sgi.com>
Thu, 22 Mar 2012 20:31:06 +0000 (15:31 -0500)
commit5575acc7807595687288b3bbac15103f2a5462e1
tree1a47a34756e1c0023e2df8f3b1d9e10de568601a
parent1c2ccc66bcef992bec7bad6d52cade66d632d7fb
xfs: fix deadlock in xfs_rtfree_extent

To fix the deadlock caused by repeatedly calling xfs_rtfree_extent

 - removed xfs_ilock() and xfs_trans_ijoin() from xfs_rtfree_extent(),
   instead added asserts that the inode is locked and has an inode_item
   attached to it.
 - in xfs_bunmapi() when dealing with an inode with the rt flag
   call xfs_ilock() and xfs_trans_ijoin() so that the
   reference count is bumped on the inode and attached it to the
   transaction before calling into xfs_bmap_del_extent, similar to
   what we do in xfs_bmap_rtalloc.

Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_bmap.c
fs/xfs/xfs_rtalloc.c