From 7882af95dd3849b966a2f407b949ce13fe6c64ff Mon Sep 17 00:00:00 2001 From: vegbir Date: Mon, 4 Jul 2022 17:23:16 +0800 Subject: [PATCH] enable cfs option to show correct proc cpuinfo view (cherry picked from commit f8592c6f765e07b0cc4594fd60e16b3f5c215cab) --- 0006-fix-concurrency-problem.patch | 4 +-- 0007-set-null-after-free.patch | 6 ++--- ...on-to-show-correct-proc-cpuinfo-view.patch | 25 +++++++++++++++++++ lxcfs.spec | 6 ++++- 4 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 0020-enable-cfs-option-to-show-correct-proc-cpuinfo-view.patch diff --git a/0006-fix-concurrency-problem.patch b/0006-fix-concurrency-problem.patch index 2034919..b005f2e 100644 --- a/0006-fix-concurrency-problem.patch +++ b/0006-fix-concurrency-problem.patch @@ -87,9 +87,9 @@ index bcd624d..0aaab71 100644 { struct file_info *f = INTTYPE_TO_PTR(fi->fh); -+ if (!f->buf) ++ if (!f->buf) + return -EINVAL; -+ ++ switch (f->type) { case LXC_TYPE_PROC_MEMINFO: if (liblxcfs_functional()) diff --git a/0007-set-null-after-free.patch b/0007-set-null-after-free.patch index 2f50681..1f6db68 100644 --- a/0007-set-null-after-free.patch +++ b/0007-set-null-after-free.patch @@ -145,7 +145,7 @@ index 5c22fd1..b396bbc 100644 + for (i = 0; clist[i]; i++) { free(clist[i]); + clist[i] = NULL; -+ } ++ } free(clist); } return ret; @@ -251,7 +251,7 @@ index c689c8e..a7e4a58 100644 + for (int i = 0; list[i]; i++) { free(list[i]); + list[i] = NULL; -+ } ++ } free_disarm(list); } } @@ -267,7 +267,7 @@ index 5f9bec7..c8daf35 100644 + for (; i > 0; i--) { free(idbuf[i - 1]); + idbuf[i - 1] = NULL; -+ } ++ } out: free(idbuf); + idbuf = NULL; diff --git a/0020-enable-cfs-option-to-show-correct-proc-cpuinfo-view.patch b/0020-enable-cfs-option-to-show-correct-proc-cpuinfo-view.patch new file mode 100644 index 0000000..ac48717 --- /dev/null +++ b/0020-enable-cfs-option-to-show-correct-proc-cpuinfo-view.patch @@ -0,0 +1,25 @@ +From ba38ee0ef8e375ae7e1b19d6e99626b1152ddef8 Mon Sep 17 00:00:00 2001 +From: vegbir +Date: Mon, 4 Jul 2022 17:15:19 +0800 +Subject: [PATCH] enable cfs option to show correct proc cpuinfo view + +--- + config/init/systemd/lxcfs.service | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/config/init/systemd/lxcfs.service b/config/init/systemd/lxcfs.service +index dbb029f..f24e11b 100644 +--- a/config/init/systemd/lxcfs.service ++++ b/config/init/systemd/lxcfs.service +@@ -5,7 +5,7 @@ Before=lxc.service + Documentation=man:lxcfs(1) + + [Service] +-ExecStart=/usr/bin/lxcfs /usr/local/var/lib/lxcfs ++ExecStart=/usr/bin/lxcfs --enable-cfs /usr/local/var/lib/lxcfs + KillMode=process + Restart=on-failure + ExecStopPost=-/bin/fusermount -u /usr/local/var/lib/lxcfs +-- +2.32.1 (Apple Git-133) + diff --git a/lxcfs.spec b/lxcfs.spec index 854cc9d..b6b7e2c 100644 --- a/lxcfs.spec +++ b/lxcfs.spec @@ -4,7 +4,7 @@ #Basic Information Name: lxcfs Version: 4.0.11 -Release: 3 +Release: 4 Summary: FUSE filesystem for LXC License: LGPL 2.1+ URL: http://linuxcontainers.org @@ -29,6 +29,7 @@ Patch9016: 0016-remove-lxcfs-tools-dependency-for-common-use.patch Patch9017: 0017-proc_fuse-fix-wait-child-process-hang.patch Patch9018: 0018-fix-deadlock-problem-when-subprocess-exit.patch Patch9019: 0019-fix-dev-read-memory-leak-in-container.patch +Patch9020: 0020-enable-cfs-option-to-show-correct-proc-cpuinfo-view.patch #Dependency BuildRequires: autoconf automake libtool help2man @@ -90,6 +91,9 @@ fi %{_unitdir}/* %changelog +* Mon Jul 04 2022 yangjiaqi - 4.0.11-4 +- enable cfs option to show correct proc cpuinfo view + * Wed May 11 2022 zhangsong234 - 4.0.11-3 - fix dev read memory leak in container -- Gitee