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

Commit f83282a8 authored by Dave Chinner's avatar Dave Chinner Committed by Alex Elder
Browse files

xfs: fix per-ag reference counting in inode reclaim tree walking



The walk fails to decrement the per-ag reference count when the
non-blocking walk fails to obtain the per-ag reclaim lock, leading
to an assert failure on debug kernels when unmounting a filesystem.

Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
parent 6762b938
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -853,6 +853,7 @@ xfs_reclaim_inodes_ag(
		if (trylock) {
		if (trylock) {
			if (!mutex_trylock(&pag->pag_ici_reclaim_lock)) {
			if (!mutex_trylock(&pag->pag_ici_reclaim_lock)) {
				skipped++;
				skipped++;
				xfs_perag_put(pag);
				continue;
				continue;
			}
			}
			first_index = pag->pag_ici_reclaim_cursor;
			first_index = pag->pag_ici_reclaim_cursor;
+1 −0
Original line number Original line Diff line number Diff line
@@ -275,6 +275,7 @@ xfs_free_perag(
		pag = radix_tree_delete(&mp->m_perag_tree, agno);
		pag = radix_tree_delete(&mp->m_perag_tree, agno);
		spin_unlock(&mp->m_perag_lock);
		spin_unlock(&mp->m_perag_lock);
		ASSERT(pag);
		ASSERT(pag);
		ASSERT(atomic_read(&pag->pag_ref) == 0);
		call_rcu(&pag->rcu_head, __xfs_free_perag);
		call_rcu(&pag->rcu_head, __xfs_free_perag);
	}
	}
}
}