diff options
Diffstat (limited to 'fs/xfs/xfs_iget.c')
-rw-r--r-- | fs/xfs/xfs_iget.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index 5be89d760a9a..4c92d190b3bd 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c | |||
@@ -210,9 +210,6 @@ finish_inode: | |||
210 | 210 | ||
211 | xfs_itrace_exit_tag(ip, "xfs_iget.alloc"); | 211 | xfs_itrace_exit_tag(ip, "xfs_iget.alloc"); |
212 | 212 | ||
213 | if (lock_flags) | ||
214 | xfs_ilock(ip, lock_flags); | ||
215 | |||
216 | if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) { | 213 | if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) { |
217 | xfs_idestroy(ip); | 214 | xfs_idestroy(ip); |
218 | xfs_put_perag(mp, pag); | 215 | xfs_put_perag(mp, pag); |
@@ -228,6 +225,10 @@ finish_inode: | |||
228 | delay(1); | 225 | delay(1); |
229 | goto again; | 226 | goto again; |
230 | } | 227 | } |
228 | |||
229 | if (lock_flags) | ||
230 | xfs_ilock(ip, lock_flags); | ||
231 | |||
231 | mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1); | 232 | mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1); |
232 | first_index = agino & mask; | 233 | first_index = agino & mask; |
233 | write_lock(&pag->pag_ici_lock); | 234 | write_lock(&pag->pag_ici_lock); |
@@ -239,6 +240,8 @@ finish_inode: | |||
239 | BUG_ON(error != -EEXIST); | 240 | BUG_ON(error != -EEXIST); |
240 | write_unlock(&pag->pag_ici_lock); | 241 | write_unlock(&pag->pag_ici_lock); |
241 | radix_tree_preload_end(); | 242 | radix_tree_preload_end(); |
243 | if (lock_flags) | ||
244 | xfs_iunlock(ip, lock_flags); | ||
242 | xfs_idestroy(ip); | 245 | xfs_idestroy(ip); |
243 | XFS_STATS_INC(xs_ig_dup); | 246 | XFS_STATS_INC(xs_ig_dup); |
244 | goto again; | 247 | goto again; |