From dc4e11fa3d7cc2dfcf5fb526e16e6d54e4cf40b1 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Wed, 3 Jun 2026 23:08:14 -0700 Subject: [PATCH] xfs_scrub: don't return garbage value from bulkstat_the_rest 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" Reviewed-by: Andrey Albershteyn --- scrub/inodes.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scrub/inodes.c b/scrub/inodes.c index bfd4abc4..ab5cf393 100644 --- a/scrub/inodes.c +++ b/scrub/inodes.c @@ -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 { -- 2.47.3