]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_scrub: don't leak the autofsck fsproperty handle
authorDarrick J. Wong <djwong@kernel.org>
Wed, 24 Jun 2026 18:17:06 +0000 (11:17 -0700)
committerAndrey Albershteyn <aalbersh@kernel.org>
Thu, 25 Jun 2026 13:42:53 +0000 (15:42 +0200)
Codex notices that we leak the fsproperty handle if the filesystem
doesn't actually have the property set.  Fix that by moving the free
call; it can handle a totally nulled out structure.

Cc: linux-xfs@vger.kernel.org # v6.10.0
Fixes: 9451b5ee0d0d2d ("xfs_scrub: allow sysadmin to control background scrubs")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/phase1.c

index 6ac59264b50bb7e590012364d4e0e975c60fc995..620a12393b3658e0431406eb628558db1923b884 100644 (file)
@@ -178,8 +178,6 @@ mode_from_autofsck(
                break;
        }
 
-       fsprops_free_handle(&fph);
-
 summarize:
        switch (ctx->mode) {
        case SCRUB_MODE_NONE:
@@ -200,6 +198,7 @@ summarize:
                break;
        }
 
+       fsprops_free_handle(&fph);
        return;
 no_property:
        /*