]> git.proxmox.com Git - lxcfs.git/commitdiff
added pending uptime fix
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 16 Dec 2015 11:19:24 +0000 (12:19 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 18 Dec 2015 08:14:36 +0000 (09:14 +0100)
debian/patches/0001-uptime-fix-pid1-and-reaper_busy-times.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0001-uptime-fix-pid1-and-reaper_busy-times.patch b/debian/patches/0001-uptime-fix-pid1-and-reaper_busy-times.patch
new file mode 100644 (file)
index 0000000..d4c24c9
--- /dev/null
@@ -0,0 +1,45 @@
+From bb3f1796d71b17a2dd0502b2c43a38d6d07efb46 Mon Sep 17 00:00:00 2001
+From: Wolfgang Bumiller <w.bumiller@proxmox.com>
+Date: Mon, 14 Dec 2015 08:57:12 +0100
+Subject: [PATCH lxcfs] uptime: fix pid1 and reaper_busy times
+
+- reaper_busy was off by a factor of 10 (possibly originally
+for precision?)
+- get_pid1_time was expecting a '1' byte like in
+the pid_to/from_ns_wrapper functions instead of reading its
+value which is what is actually written
+
+Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
+---
+ lxcfs.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/lxcfs.c b/lxcfs.c
+index 90a0b7f..fe5ac3e 100644
+--- a/lxcfs.c
++++ b/lxcfs.c
+@@ -2449,10 +2449,9 @@ static long int get_pid1_time(pid_t pid)
+       ret = select(cpipe[0]+1, &s, NULL, NULL, &tv);
+       if (ret <= 0)
+               goto fail;
+-      ret = read(cpipe[0], &v, 1);
+-      if (ret != sizeof(char) || v != '1') {
++      ret = read(cpipe[0], &v, sizeof(v));
++      if (ret != sizeof(v))
+               goto fail;
+-      }
+       wait_for_pid(cpid);
+@@ -2607,7 +2606,7 @@ static unsigned long get_reaper_busy(pid_t task)
+       if (!cgfs_get_value("cpuacct", cgroup, "cpuacct.usage", &usage_str))
+               goto out;
+       usage = strtoul(usage_str, NULL, 10);
+-      usage /= 100000000;
++      usage /= 1000000000;
+ out:
+       free(cgroup);
+-- 
+2.1.4
+
index bf650b42b1037ca3c7f99c19421c9e1728402554..593580f696ff5927fba3f47bd692c6c8fc612cf5 100644 (file)
@@ -1 +1,2 @@
 do-not-start-without-lxcfs.patch
 do-not-start-without-lxcfs.patch
+0001-uptime-fix-pid1-and-reaper_busy-times.patch