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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
Closes openzfs#10445
  • Loading branch information
lundman authored and RageLtMan committed May 31, 2021
1 parent 1b431f2 commit 8179ede
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 8179ede

Please sign in to comment.