George Anzinger 78fa74a23b [PATCH] posix timers: fix normalization problem
(We found this (after a customer complained) and it is in the kernel.org
kernel.  Seems that for CLOCK_MONOTONIC absolute timers and clock_nanosleep
calls both the request time and wall_to_monotonic are subtracted prior to
the normalize resulting in an overflow in the existing normalize test.
This causes the result to be shifted ~4 seconds ahead instead of ~2 seconds
back in time.)

The normalize code in posix-timers.c fails when the tv_nsec member is ~1.2
seconds negative.  This can happen on absolute timers (and
clock_nanosleeps) requested on CLOCK_MONOTONIC (both the request time and
wall_to_monotonic are subtracted resulting in the possibility of a number
close to -2 seconds.)

This fix uses the set_normalized_timespec() (which does not have an
overflow problem) to fix the problem and as a side effect makes the code
cleaner.

Signed-off-by: George Anzinger <george@mvista.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-28 21:46:05 -07:00
..
2005-06-28 21:20:35 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:24:01 -07:00
2005-04-16 15:20:36 -07:00
2005-06-25 16:24:29 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-07-12 16:00:58 -07:00
2005-04-16 15:20:36 -07:00
2005-07-27 16:25:51 -07:00
2005-06-28 14:53:40 -07:00
2005-04-16 15:20:36 -07:00
2005-06-24 00:06:43 -07:00
2005-04-16 15:20:36 -07:00
2005-04-16 15:20:36 -07:00
2005-06-25 16:24:34 -07:00
2005-07-07 18:23:46 -07:00
2005-04-16 15:20:36 -07:00
2005-07-12 20:38:38 -07:00
2005-07-27 16:46:37 -07:00
2005-07-27 16:26:04 -07:00
2005-04-16 15:20:36 -07:00
2005-07-12 20:38:38 -07:00
2005-04-16 15:20:36 -07:00