]> git.proxmox.com Git - lxcfs.git/commitdiff
merge: (temporarily?) revert the virtualization of btime field in /proc/stat
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 4 Aug 2017 06:18:09 +0000 (08:18 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 4 Aug 2017 06:21:57 +0000 (08:21 +0200)
Fixes lxcfs#189

debian/patches/0003-temporarily-revert-the-virtualization-of-btime-field.patch [new file with mode: 0644]
debian/patches/series

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 (file)
index 0000000..16a1418
--- /dev/null
@@ -0,0 +1,37 @@
+From b882da1d3539231b7ca84814980303c33cad9c7f Mon Sep 17 00:00:00 2001
+From: Serge Hallyn <serge@hallyn.com>
+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 <serge@hallyn.com>
+---
+ 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
+
index 7bedaf18a845de7ee1a11c49ef756894bd4a3ea3..aa2a478a31f36d592c758662929558653d3f5724 100644 (file)
@@ -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