]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs_repair: fix crasher in pf_queuing_worker
authorDarrick J. Wong <djwong@kernel.org>
Thu, 14 Nov 2024 23:53:24 +0000 (15:53 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 21 Nov 2024 00:03:44 +0000 (16:03 -0800)
Don't walk off the end of the inode records when we're skipping inodes
for prefetching.  The skip loop doesn't make sense to me -- why we
ignore the first N inodes but don't care what number they are makes
little sense to me.  But let's fix xfs/155 to crash less, eh?

Cc: <linux-xfs@vger.kernel.org> # v2.10.0
Fixes: 2556c98bd9e6b2 ("Perform true sequential bulk read prefetching in xfs_repair Merge of master-melb:xfs-cmds:29147a by kenmcd.")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
repair/prefetch.c

index 998797e3696bace89d8f7590124be517a0899a8d..0772ecef9d73ebf2e814a08c7b0a5ef9453f8fdd 100644 (file)
@@ -764,6 +764,8 @@ pf_queuing_worker(
                        irec = next_ino_rec(irec);
                        num_inos += XFS_INODES_PER_CHUNK;
                }
+               if (!irec)
+                       break;
 
                if (args->dirs_only && cur_irec->ino_isa_dir == 0)
                        continue;