Blame SOURCES/github_46d21219.patch

7ef056
commit 46d2121960d81354facf4e2558c81f82257b740e
7ef056
Author: Dave Anderson <anderson@redhat.com>
7ef056
Date:   Tue May 29 14:04:03 2018 -0400
7ef056
7ef056
    Fix for the "timer -r" command on Linux 4.10 and later kernels that
7ef056
    contain commit 2456e855354415bfaeb7badaa14e11b3e02c8466, titled
7ef056
    "ktime: Get rid of the union".  Without the patch, the command fails
7ef056
    with the error message "timer: invalid structure member offset:
7ef056
    ktime_t_sec".
7ef056
    (k-hagio@ab.jp.nec.com)
7ef056
7ef056
diff --git a/kernel.c b/kernel.c
7ef056
index b1886ce..138a47f 100644
7ef056
--- a/kernel.c
7ef056
+++ b/kernel.c
7ef056
@@ -7740,7 +7740,7 @@ ktime_to_ns(const void *ktime)
7ef056
 	if (VALID_MEMBER(ktime_t_tv64)) {
7ef056
 		readmem((ulong)ktime + OFFSET(ktime_t_tv64), KVADDR, &ns,
7ef056
 			sizeof(ns), "ktime_t tv64", QUIET|RETURN_ON_ERROR);
7ef056
-	} else {
7ef056
+	} else if (VALID_MEMBER(ktime_t_sec) && VALID_MEMBER(ktime_t_nsec)) {
7ef056
 		uint32_t sec, nsec;
7ef056
 
7ef056
 		sec = 0;
7ef056
@@ -7753,6 +7753,9 @@ ktime_to_ns(const void *ktime)
7ef056
 			sizeof(nsec), "ktime_t nsec", QUIET|RETURN_ON_ERROR);
7ef056
 
7ef056
 		ns = sec * 1000000000L + nsec;
7ef056
+	} else {
7ef056
+		readmem((ulong)ktime, KVADDR, &ns,
7ef056
+			sizeof(ns), "ktime_t", QUIET|RETURN_ON_ERROR);
7ef056
 	}
7ef056
 
7ef056
 	return ns;