]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_scrub: don't return garbage value from bulkstat_the_rest
authorDarrick J. Wong <djwong@kernel.org>
Thu, 4 Jun 2026 06:08:14 +0000 (23:08 -0700)
committerAndrey Albershteyn <aalbersh@kernel.org>
Thu, 11 Jun 2026 10:26:04 +0000 (12:26 +0200)
bulkstat_the_rest returns an inode mask, but Codex noticed that we
carelessly return an error number if we can't allocate a bulkstat
request.  Fix this by returning 0, which forces the caller to singlestep
the rest of the bulkstat array.

Cc: linux-xfs@vger.kernel.org # v6.14.0
Fixes: 7ae92e1cb0aeeb ("xfs_scrub: try harder to fill the bulkstat array with bulkstat()")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
scrub/inodes.c

index bfd4abc44b56de45d59fc11845c8f84794b4764b..ab5cf393327f1a6cb8a143bb066481ed38308341 100644 (file)
@@ -152,8 +152,13 @@ bulkstat_the_rest(
        error = -xfrog_bulkstat_alloc_req(
                        orig_breq->hdr.icount - orig_breq->hdr.ocount,
                        start_ino, &new_breq);
-       if (error)
-               return error;
+       if (error) {
+               /*
+                * Couldn't allocate memory for bulkstat, so we return 0 and
+                * let the caller single-step.
+                */
+               return 0;
+       }
        new_breq->hdr.flags = orig_breq->hdr.flags;
 
        do {