From: Eric Sandeen Date: Tue, 30 Oct 2018 21:51:58 +0000 (-0500) Subject: xfs_repair: kick processing thread if ra_count is at limit X-Git-Tag: v4.19.0-rc1~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7cf2aa1adc94093331f4ad0139c637b392765a0c;p=thirdparty%2Fxfsprogs-dev.git xfs_repair: kick processing thread if ra_count is at limit Zorro hit an xfs_repair hang on a 500T filesystem where all the prefetch threads were sleeping and nothing progressed. The problem is that if every buffer we tried to read ahead in phase6 was already up to date, pf_start_io_workers has no effect; there is no io to do, and the sem_wait in pf_queuing_worker waits forever. Kick the processing thread to avoid this situation. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201173 Signed-off-by: Eric Sandeen Reviewed-by: Dave Chinner Signed-off-by: Eric Sandeen --- diff --git a/repair/prefetch.c b/repair/prefetch.c index 9571b2491..1de0e2ff4 100644 --- a/repair/prefetch.c +++ b/repair/prefetch.c @@ -768,8 +768,12 @@ pf_queuing_worker( * might get stuck on a buffer that has been locked * and added to the I/O queue but is waiting for * the thread to be woken. + * Start processing as well, in case everything so + * far was already prefetched and the queue is empty. */ + pf_start_io_workers(args); + pf_start_processing(args); sem_wait(&args->ra_count); }