aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_rtalloc.c
diff options
context:
space:
mode:
authorKamal Dasu <kdasu.kdev@gmail.com>2012-02-22 19:41:39 -0500
committerBen Myers <bpm@sgi.com>2012-03-22 16:31:06 -0400
commit5575acc7807595687288b3bbac15103f2a5462e1 (patch)
tree1a47a34756e1c0023e2df8f3b1d9e10de568601a /fs/xfs/xfs_rtalloc.c
parent1c2ccc66bcef992bec7bad6d52cade66d632d7fb (diff)
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>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.c')
-rw-r--r--fs/xfs/xfs_rtalloc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 87323f1ded64..ca4f31534a0a 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -183,6 +183,7 @@ error_cancel:
183 oblocks = map.br_startoff + map.br_blockcount; 183 oblocks = map.br_startoff + map.br_blockcount;
184 } 184 }
185 return 0; 185 return 0;
186
186error: 187error:
187 return error; 188 return error;
188} 189}
@@ -2139,11 +2140,9 @@ xfs_rtfree_extent(
2139 xfs_buf_t *sumbp; /* summary file block buffer */ 2140 xfs_buf_t *sumbp; /* summary file block buffer */
2140 2141
2141 mp = tp->t_mountp; 2142 mp = tp->t_mountp;
2142 /* 2143
2143 * Synchronize by locking the bitmap inode. 2144 ASSERT(mp->m_rbmip->i_itemp != NULL);
2144 */ 2145 ASSERT(xfs_isilocked(mp->m_rbmip, XFS_ILOCK_EXCL));
2145 xfs_ilock(mp->m_rbmip, XFS_ILOCK_EXCL);
2146 xfs_trans_ijoin(tp, mp->m_rbmip, XFS_ILOCK_EXCL);
2147 2146
2148#if defined(__KERNEL__) && defined(DEBUG) 2147#if defined(__KERNEL__) && defined(DEBUG)
2149 /* 2148 /*