Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f338f903 authored by Lachlan McIlroy's avatar Lachlan McIlroy
Browse files

[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: default avatarLachlan McIlroy <lachlan@sgi.com>
Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
parent a357a121
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -210,9 +210,6 @@ finish_inode:

	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)) {
		xfs_idestroy(ip);
		xfs_put_perag(mp, pag);
@@ -228,6 +225,10 @@ finish_inode:
		delay(1);
		goto again;
	}

	if (lock_flags)
		xfs_ilock(ip, lock_flags);

	mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1);
	first_index = agino & mask;
	write_lock(&pag->pag_ici_lock);
@@ -239,6 +240,8 @@ finish_inode:
		BUG_ON(error != -EEXIST);
		write_unlock(&pag->pag_ici_lock);
		radix_tree_preload_end();
		if (lock_flags)
			xfs_iunlock(ip, lock_flags);
		xfs_idestroy(ip);
		XFS_STATS_INC(xs_ig_dup);
		goto again;