From 4f73576ea15fcf38b344b008eaf355480a08bbff Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Mon, 15 Jun 2020 02:08:21 +0900 Subject: Upstream: zil_commit_waiter() can stall forever On macOS clock_t is unsigned, so when cv_timedwait_hires() returns -1 we loop forever. The conditional was tweaked to ignore signedness. Reviewed-by: Matthew Ahrens Reviewed-by: Brian Behlendorf Signed-off-by: Jorgen Lundman Closes #10445 --- module/zfs/zil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/zil.c b/module/zfs/zil.c index 1c122f35a..34495af55 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -2691,7 +2691,7 @@ zil_commit_waiter(zilog_t *zilog, zil_commit_waiter_t *zcw) &zcw->zcw_lock, wakeup, USEC2NSEC(1), CALLOUT_FLAG_ABSOLUTE); - if (timeleft >= 0 || zcw->zcw_done) + if (timeleft != -1 || zcw->zcw_done) continue; timedout = B_TRUE; -- cgit v1.2.3