From: Darrick J. Wong Date: Mon, 15 Apr 2024 23:07:50 +0000 (-0700) Subject: xfs_repair: clean up lock resources X-Git-Tag: v6.8.0~13 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0b1e67af12a15db5669c355d82eceb93704b40cd;p=xfsprogs-dev.git xfs_repair: clean up lock resources When we free all the incore block mapping data, be sure to free the locks too. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- diff --git a/repair/incore.c b/repair/incore.c index 2ed37a105..06edaf0d6 100644 --- a/repair/incore.c +++ b/repair/incore.c @@ -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;