aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2013-05-24 15:55:09 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-07 12:46:36 -0700
commit26deb18bd5aa6e3d7099b291038fef47b31cbf69 (patch)
treed7f6f76962d06b11d9f29d93864f6b14b210df5a /fs
parent929b30b9d3f530900c6e3176b1cf29fbcf307e25 (diff)
downloadkernel_samsung_smdk4412-26deb18bd5aa6e3d7099b291038fef47b31cbf69.zip
kernel_samsung_smdk4412-26deb18bd5aa6e3d7099b291038fef47b31cbf69.tar.gz
kernel_samsung_smdk4412-26deb18bd5aa6e3d7099b291038fef47b31cbf69.tar.bz2
wait: fix false timeouts when using wait_event_timeout()
commit 4c663cfc523a88d97a8309b04a089c27dc57fd7e upstream. Many callers of the wait_event_timeout() and wait_event_interruptible_timeout() expect that the return value will be positive if the specified condition becomes true before the timeout elapses. However, at the moment this isn't guaranteed. If the wake-up handler is delayed enough, the time remaining until timeout will be calculated as 0 - and passed back as a return value - even if the condition became true before the timeout has passed. Fix this by returning at least 1 if the condition becomes true. This semantic is in line with what wait_for_condition_timeout() does; see commit bb10ed09 ("sched: fix wait_for_completion_timeout() spurious failure under heavy load"). Daniel said "We have 3 instances of this bug in drm/i915. One case even where we switch between the interruptible and not interruptible wait_event_timeout variants, foolishly presuming they have the same semantics. I very much like this." One such bug is reported at https://bugs.freedesktop.org/show_bug.cgi?id=64133 Signed-off-by: Imre Deak <imre.deak@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: David Howells <dhowells@redhat.com> Acked-by: Jens Axboe <axboe@kernel.dk> Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Cc: Dave Jones <davej@redhat.com> Cc: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
0 files changed, 0 insertions, 0 deletions