]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: don't assert fail on perag references on teardown
authorDave Chinner <dchinner@redhat.com>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 22 Jun 2022 19:28:52 +0000 (14:28 -0500)
Source kernel commit: 5b55cbc2d72632e874e50d2e36bce608e55aaaea

Not fatal, the assert is there to catch developer attention. I'm
seeing this occasionally during recoveryloop testing after a
shutdown, and I don't want this to stop an overnight recoveryloop
run as it is currently doing.

Convert the ASSERT to a XFS_IS_CORRUPT() check so it will dump a
corruption report into the log and cause a test failure that way,
but it won't stop the machine dead.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_ag.c

index c8181d7fbcc9e3fd8d7014e01ccc06a21f917b64..b931cd69444e4517a92a35dc94021fba64f33b43 100644 (file)
@@ -171,7 +171,6 @@ __xfs_free_perag(
        struct xfs_perag *pag = container_of(head, struct xfs_perag, rcu_head);
 
        ASSERT(!delayed_work_pending(&pag->pag_blockgc_work));
-       ASSERT(atomic_read(&pag->pag_ref) == 0);
        kmem_free(pag);
 }
 
@@ -190,7 +189,7 @@ xfs_free_perag(
                pag = radix_tree_delete(&mp->m_perag_tree, agno);
                spin_unlock(&mp->m_perag_lock);
                ASSERT(pag);
-               ASSERT(atomic_read(&pag->pag_ref) == 0);
+               XFS_IS_CORRUPT(pag->pag_mount, atomic_read(&pag->pag_ref) != 0);
 
                cancel_delayed_work_sync(&pag->pag_blockgc_work);
                xfs_iunlink_destroy(pag);