[lxc-devel] [lxcfs/master] (temporarily?) revert the virtualization of btime field in /proc/stat

hallyn on Github lxc-bot at linuxcontainers.org
Sun Jun 18 19:46:20 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 593 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170618/289ce49d/attachment.bin>
-------------- next part --------------
From 9502bae2b6e9a62a870c303e9776722082f6ce6c Mon Sep 17 00:00:00 2001
From: Serge Hallyn <serge at hallyn.com>
Date: Sun, 18 Jun 2017 14:43:22 -0500
Subject: [PATCH] (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 at hallyn.com>
---
 bindings.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/bindings.c b/bindings.c
index f3aefa1..1442b9a 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;


More information about the lxc-devel mailing list