Skip to content

Commit

Permalink
Upstream: zil_commit_waiter() can stall forever
Browse files Browse the repository at this point in the history
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 openzfs#10445
  • Loading branch information
lundman authored and jsai20 committed Mar 30, 2021
1 parent fdac190 commit 65d7315
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/zil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 65d7315

Please sign in to comment.