]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_repair: clean up lock resources
authorDarrick J. Wong <djwong@djwong.org>
Mon, 15 Apr 2024 23:07:50 +0000 (16:07 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 17 Apr 2024 21:06:28 +0000 (14:06 -0700)
When we free all the incore block mapping data, be sure to free the
locks too.

Signed-off-by: Darrick J. Wong <djwong@djwong.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
repair/incore.c

index 2ed37a105ca708f22969846216bb8ec11ec75d0e..06edaf0d60526285a60afa175490ea88906ebaff 100644 (file)
@@ -301,8 +301,17 @@ free_bmaps(xfs_mount_t *mp)
 {
        xfs_agnumber_t i;
 
+       pthread_mutex_destroy(&rt_lock.lock);
+
+       for (i = 0; i < mp->m_sb.sb_agcount; i++)
+               pthread_mutex_destroy(&ag_locks[i].lock);
+
+       free(ag_locks);
+       ag_locks = NULL;
+
        for (i = 0; i < mp->m_sb.sb_agcount; i++)
                btree_destroy(ag_bmap[i]);
+
        free(ag_bmap);
        ag_bmap = NULL;