diff options
author | Andrei Vagin <avagin@gmail.com> | 2019-11-12 02:27:04 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2020-01-14 12:20:55 +0100 |
commit | 0b9b9a3b162e85e620e3598f1badc45b8a177492 (patch) | |
tree | e73af7a865a9d9c52991a419a8791605c31878e7 /kernel/time | |
parent | posix-timers: Make timer_settime() time namespace aware (diff) | |
download | linux-0b9b9a3b162e85e620e3598f1badc45b8a177492.tar.xz linux-0b9b9a3b162e85e620e3598f1badc45b8a177492.zip |
alarmtimer: Make nanosleep() time namespace aware
clock_nanosleep() accepts absolute values of expiration time when the
TIMER_ABSTIME flag is set. This absolute value is inside the task's
time namespace and has to be converted to the host's time.
Co-developed-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20191112012724.250792-16-dima@arista.com
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/alarmtimer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 9a8e81bc4ec2..b51b36e533c4 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -839,6 +839,8 @@ static int alarm_timer_nsleep(const clockid_t which_clock, int flags, ktime_t now = alarm_bases[type].get_ktime(); exp = ktime_add_safe(now, exp); + } else { + exp = timens_ktime_to_host(which_clock, exp); } ret = alarmtimer_do_nsleep(&alarm, exp, type); |