From: Oleg Nesterov Date: Wed, 23 Nov 2011 17:28:17 +0000 (-0800) Subject: freezer: fix wait_event_freezable/__thaw_task races X-Git-Tag: v3.3-rc1~148^2~24^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24b7ead3fb0bae267c2ee50898eb4c13aedd1e9f;p=pandora-kernel.git 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: Oleg Nesterov Acked-by: Tejun Heo --- Reading git-diff-tree failed