From 1dbcb28da38afdfbc4adb676bfb0bc76f7b2f8fc Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Mon, 24 Feb 2025 10:21:43 -0800 Subject: [PATCH] xfs_scrub: return early from bulkstat_for_inumbers if no bulkstat data If bulkstat doesn't return an error code or any bulkstat records, we've hit the end of the filesystem, so return early. This can happen if the inumbers data came from the very last inobt record in the filesystem and every inode in that inobt record is freed immediately after INUMBERS. There's no bug here, it's just a minor optimization. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- scrub/inodes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scrub/inodes.c b/scrub/inodes.c index 4d3ec07b..3b9026ce 100644 --- a/scrub/inodes.c +++ b/scrub/inodes.c @@ -65,7 +65,9 @@ bulkstat_for_inumbers( /* First we try regular bulkstat, for speed. */ breq->hdr.ino = inumbers->xi_startino; - xfrog_bulkstat(&ctx->mnt, breq); + error = -xfrog_bulkstat(&ctx->mnt, breq); + if (!error && !breq->hdr.ocount) + return; /* * Bulkstat might return inodes beyond xi_startino + CHUNKSIZE. Reduce -- 2.47.2