From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Check for failures in the timedwait for progressbar reporting. Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- scrub/progress.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scrub/progress.c b/scrub/progress.c index 6d4f2c36..14eaf8d3 100644 --- a/scrub/progress.c +++ b/scrub/progress.c @@ -130,7 +130,9 @@ progress_report_thread(void *arg) abstime.tv_sec++; abstime.tv_nsec -= NSEC_PER_SEC; } - pthread_cond_timedwait(&pt.wakeup, &pt.lock, &abstime); + ret = pthread_cond_timedwait(&pt.wakeup, &pt.lock, &abstime); + if (ret && ret != ETIMEDOUT) + break; if (pt.terminate) break; ret = ptcounter_value(pt.ptc, &progress_val);