mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
[XFS] Unlock inode before calling xfs_idestroy()
Lock debugging reported the ilock was being destroyed without being unlocked. We don't need to lock the inode until we are going to insert it into the radix tree. SGI-PV: 987246 SGI-Modid: xfs-linux-melb:xfs-kern:32159a Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org>
This commit is contained in:
parent
a357a12156
commit
f338f90364
1 changed files with 6 additions and 3 deletions
|
@ -210,9 +210,6 @@ xfs_iget_core(
|
||||||
|
|
||||||
xfs_itrace_exit_tag(ip, "xfs_iget.alloc");
|
xfs_itrace_exit_tag(ip, "xfs_iget.alloc");
|
||||||
|
|
||||||
if (lock_flags)
|
|
||||||
xfs_ilock(ip, lock_flags);
|
|
||||||
|
|
||||||
if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) {
|
if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) {
|
||||||
xfs_idestroy(ip);
|
xfs_idestroy(ip);
|
||||||
xfs_put_perag(mp, pag);
|
xfs_put_perag(mp, pag);
|
||||||
|
@ -228,6 +225,10 @@ xfs_iget_core(
|
||||||
delay(1);
|
delay(1);
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lock_flags)
|
||||||
|
xfs_ilock(ip, lock_flags);
|
||||||
|
|
||||||
mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1);
|
mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1);
|
||||||
first_index = agino & mask;
|
first_index = agino & mask;
|
||||||
write_lock(&pag->pag_ici_lock);
|
write_lock(&pag->pag_ici_lock);
|
||||||
|
@ -239,6 +240,8 @@ xfs_iget_core(
|
||||||
BUG_ON(error != -EEXIST);
|
BUG_ON(error != -EEXIST);
|
||||||
write_unlock(&pag->pag_ici_lock);
|
write_unlock(&pag->pag_ici_lock);
|
||||||
radix_tree_preload_end();
|
radix_tree_preload_end();
|
||||||
|
if (lock_flags)
|
||||||
|
xfs_iunlock(ip, lock_flags);
|
||||||
xfs_idestroy(ip);
|
xfs_idestroy(ip);
|
||||||
XFS_STATS_INC(xs_ig_dup);
|
XFS_STATS_INC(xs_ig_dup);
|
||||||
goto again;
|
goto again;
|
||||||
|
|
Loading…
Reference in a new issue