VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   57 Tags
author: Andrei Vagin <avagin@gmail.com> 2019-11-12 01:27:02 +0000 committer: Thomas Gleixner <tglx@linutronix.de> 2020-01-14 12:20:53 +0100 commit: 6cd889d43c40b13f81a44c41896781ce70244769 parent: 89dd8eecfe961fab4924dcd14f80cf2ab2820044
Commit Summary:
timerfd: Make timerfd_settime() time namespace aware
Diffstat:
1 file changed, 3 insertions, 0 deletions
diff --git a/fs/timerfd.c b/fs/timerfd.c
index ac7f59a58f94..c5509d2448e3 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -26,6 +26,7 @@
 #include <linux/syscalls.h>
 #include <linux/compat.h>
 #include <linux/rcupdate.h>
+#include <linux/time_namespace.h>
 
 struct timerfd_ctx {
 	union {
@@ -196,6 +197,8 @@ static int timerfd_setup(struct timerfd_ctx *ctx, int flags,
 	}
 
 	if (texp != 0) {
+		if (flags & TFD_TIMER_ABSTIME)
+			texp = timens_ktime_to_host(clockid, texp);
 		if (isalarm(ctx)) {
 			if (flags & TFD_TIMER_ABSTIME)
 				alarm_start(&ctx->t.alarm, texp);