From 3bc99faecbd9838d9ee811609e1ebd49ec158c5c Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 4 Aug 2017 08:18:09 +0200 Subject: [PATCH] merge: (temporarily?) revert the virtualization of btime field in /proc/stat Fixes lxcfs#189 --- ...rt-the-virtualization-of-btime-field.patch | 37 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 38 insertions(+) create mode 100644 debian/patches/0003-temporarily-revert-the-virtualization-of-btime-field.patch diff --git a/debian/patches/0003-temporarily-revert-the-virtualization-of-btime-field.patch b/debian/patches/0003-temporarily-revert-the-virtualization-of-btime-field.patch new file mode 100644 index 0000000..16a1418 --- /dev/null +++ b/debian/patches/0003-temporarily-revert-the-virtualization-of-btime-field.patch @@ -0,0 +1,37 @@ +From b882da1d3539231b7ca84814980303c33cad9c7f Mon Sep 17 00:00:00 2001 +From: Serge Hallyn +Date: Sun, 18 Jun 2017 14:43:22 -0500 +Subject: [PATCH lxcfs 3/4] (temporarily?) revert the virtualization of btime + field in /proc/stat + +Closes #189 + +This seems to be responsible for corrupting STIME on processlist +inside containers. Hopefully we can find a reasonable way to fix +both, but compared to unvirtualized btime field, bogus STIME field +is the greater evil here. + +Signed-off-by: Serge Hallyn +--- + bindings.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/bindings.c b/bindings.c +index 62fc5df..9aa884a 100644 +--- a/bindings.c ++++ b/bindings.c +@@ -3672,10 +3672,7 @@ static int proc_stat_read(char *buf, size_t size, off_t offset, + continue; + if (sscanf(line, "cpu%9[^ ]", cpu_char) != 1) { + /* not a ^cpuN line containing a number N, just print it */ +- if (strncmp(line, "btime", 5) == 0) +- l = snprintf(cache, cache_size, "btime %"PRIu64"\n", get_reaper_btime(fc->pid)); +- else +- l = snprintf(cache, cache_size, "%s", line); ++ l = snprintf(cache, cache_size, "%s", line); + if (l < 0) { + perror("Error writing to cache"); + rv = 0; +-- +2.11.0 + diff --git a/debian/patches/series b/debian/patches/series index 7bedaf1..aa2a478 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ do-not-start-without-lxcfs.patch 0001-bindings-calculate-uptime-via-proc-pid-stat.patch 0002-bindings-calculate-btime-correctly.patch +0003-temporarily-revert-the-virtualization-of-btime-field.patch -- 2.39.2