aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-02-27 20:29:51 -0500
committerNathan Scott <nathans@sgi.com>2006-02-27 20:29:51 -0500
commit07ff2fa8fcb3d9207f1c16e5acf9086d5731ed8b (patch)
tree819bc2fb3e66bbaa91d6164116b96f7c1756d1f8 /fs
parent051d3cbd96909b2fe6b5038e7bbe77f41356db05 (diff)
[XFS] Fix a realtime allocator regression introduced by an old iget race
fix. Noticed by Roger Willcocks. SGI-PV: 949821 SGI-Modid: xfs-linux-melb:xfs-kern:25257a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_rtalloc.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 06fc061c50fc..5b413946b1c5 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -130,7 +130,8 @@ xfs_growfs_rt_alloc(
130 /* 130 /*
131 * Lock the inode. 131 * Lock the inode.
132 */ 132 */
133 if ((error = xfs_trans_iget(mp, tp, ino, 0, XFS_ILOCK_EXCL, &ip))) 133 if ((error = xfs_trans_iget(mp, tp, ino, 0,
134 XFS_ILOCK_EXCL, &ip)))
134 goto error_exit; 135 goto error_exit;
135 XFS_BMAP_INIT(&flist, &firstblock); 136 XFS_BMAP_INIT(&flist, &firstblock);
136 /* 137 /*
@@ -170,8 +171,8 @@ xfs_growfs_rt_alloc(
170 /* 171 /*
171 * Lock the bitmap inode. 172 * Lock the bitmap inode.
172 */ 173 */
173 if ((error = xfs_trans_iget(mp, tp, ino, 0, XFS_ILOCK_EXCL, 174 if ((error = xfs_trans_iget(mp, tp, ino, 0,
174 &ip))) 175 XFS_ILOCK_EXCL, &ip)))
175 goto error_exit; 176 goto error_exit;
176 /* 177 /*
177 * Get a buffer for the block. 178 * Get a buffer for the block.
@@ -2023,8 +2024,8 @@ xfs_growfs_rt(
2023 /* 2024 /*
2024 * Lock out other callers by grabbing the bitmap inode lock. 2025 * Lock out other callers by grabbing the bitmap inode lock.
2025 */ 2026 */
2026 if ((error = xfs_trans_iget(mp, tp, 0, mp->m_sb.sb_rbmino, 2027 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
2027 XFS_ILOCK_EXCL, &ip))) 2028 XFS_ILOCK_EXCL, &ip)))
2028 goto error_exit; 2029 goto error_exit;
2029 ASSERT(ip == mp->m_rbmip); 2030 ASSERT(ip == mp->m_rbmip);
2030 /* 2031 /*
@@ -2037,8 +2038,8 @@ xfs_growfs_rt(
2037 /* 2038 /*
2038 * Get the summary inode into the transaction. 2039 * Get the summary inode into the transaction.
2039 */ 2040 */
2040 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 2041 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0,
2041 0, XFS_ILOCK_EXCL, &ip))) 2042 XFS_ILOCK_EXCL, &ip)))
2042 goto error_exit; 2043 goto error_exit;
2043 ASSERT(ip == mp->m_rsumip); 2044 ASSERT(ip == mp->m_rsumip);
2044 /* 2045 /*
@@ -2158,10 +2159,9 @@ xfs_rtallocate_extent(
2158 /* 2159 /*
2159 * Lock out other callers by grabbing the bitmap inode lock. 2160 * Lock out other callers by grabbing the bitmap inode lock.
2160 */ 2161 */
2161 error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, &ip); 2162 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
2162 if (error) { 2163 XFS_ILOCK_EXCL, &ip)))
2163 return error; 2164 return error;
2164 }
2165 sumbp = NULL; 2165 sumbp = NULL;
2166 /* 2166 /*
2167 * Allocate by size, or near another block, or exactly at some block. 2167 * Allocate by size, or near another block, or exactly at some block.
@@ -2221,10 +2221,9 @@ xfs_rtfree_extent(
2221 /* 2221 /*
2222 * Synchronize by locking the bitmap inode. 2222 * Synchronize by locking the bitmap inode.
2223 */ 2223 */
2224 error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, &ip); 2224 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
2225 if (error) { 2225 XFS_ILOCK_EXCL, &ip)))
2226 return error; 2226 return error;
2227 }
2228#if defined(__KERNEL__) && defined(DEBUG) 2227#if defined(__KERNEL__) && defined(DEBUG)
2229 /* 2228 /*
2230 * Check to see that this whole range is currently allocated. 2229 * Check to see that this whole range is currently allocated.
@@ -2365,8 +2364,8 @@ xfs_rtpick_extent(
2365 __uint64_t seq; /* sequence number of file creation */ 2364 __uint64_t seq; /* sequence number of file creation */
2366 __uint64_t *seqp; /* pointer to seqno in inode */ 2365 __uint64_t *seqp; /* pointer to seqno in inode */
2367 2366
2368 error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, XFS_ILOCK_EXCL, &ip); 2367 if ((error = xfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0,
2369 if (error) 2368 XFS_ILOCK_EXCL, &ip)))
2370 return error; 2369 return error;
2371 ASSERT(ip == mp->m_rbmip); 2370 ASSERT(ip == mp->m_rbmip);
2372 seqp = (__uint64_t *)&ip->i_d.di_atime; 2371 seqp = (__uint64_t *)&ip->i_d.di_atime;