mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 11:40:53 +07:00
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
This commit is contained in:
parent
7da8b3a44b
commit
0b9b9a3b16
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user