Skip to content
Commit 24b7ead3 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Tejun Heo
Browse files

freezer: fix wait_event_freezable/__thaw_task races



wait_event_freezable() and friends stop the waiting if try_to_freeze()
fails. This is not right, we can race with __thaw_task() and in this
case

	- wait_event_freezable() returns the wrong ERESTARTSYS

	- wait_event_freezable_timeout() can return the positive
	  value while condition == F

Change the code to always check __retval/condition before return.

Note: with or without this patch the timeout logic looks strange,
probably we should recalc timeout if try_to_freeze() returns T.

Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarTejun Heo <tj@kernel.org>
parent 34b087e4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment