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 <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #10445
This commit is contained in:
Jorgen Lundman 2020-06-15 02:08:21 +09:00 committed by GitHub
parent f2edc0078f
commit 4f73576ea1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;