posix-cpu-timers: Respect INFINITY for hard RTTIME limit
authorThomas Gleixner <tglx@linutronix.de>
Wed, 21 Aug 2019 19:09:17 +0000 (21:09 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 28 Aug 2019 09:50:39 +0000 (11:50 +0200)
commitfe0517f893d36636de20d0a809fc0c788ca0cade
tree9315daeee3d886f94664030d8a5caefa9f0b6fb3
parentb7be4ef1365dcb56fdffc6689e41058b23f5996d
posix-cpu-timers: Respect INFINITY for hard RTTIME limit

The RTIME limit expiry code does not check the hard RTTIME limit for
INFINITY, i.e. being disabled.  Add it.

While this could be considered an ABI breakage if something would depend on
this behaviour. Though it's highly unlikely to have an effect because
RLIM_INFINITY is at minimum INT_MAX and the RTTIME limit is in seconds, so
the timer would fire after ~68 years.

Adding this obvious correct limit check also allows further consolidation
of that code and is a prerequisite for cleaning up the 0 based checks and
the rlimit setter code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/20190821192922.078293002@linutronix.de
kernel/time/posix-cpu-timers.c