From 3833171c6bc06a986f8540b06f92fee78554d334 Mon Sep 17 00:00:00 2001
From: Li Zhou
Date: Sun, 4 Feb 2024 23:51:03 -0800
Subject: [PATCH] config: don't open demote file
The Linux kernel commit
can cause "configure_controller" process failure when installing
using jenkins job.
Refer to: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/
linux.git/commit/?id=79dfc695525f60c8410015362b8aa4eb5c57210c
This commit introduces new interfaces such as:
/sys/devices/system/node/node0/hugepages/hugepages-1048576kB/demote
/sys/devices/system/node/node0/hugepages/hugepages-1048576kB/demote_size
The "demote" file is a write-only file here.
The code in node.py opens up the files for reading without even
checking if they are valid to read. This causes the failure in
"configure_controller" process.
Test plan:
The out of tree kernel modules for 6.6 aren't ready by now.
So many tests can't be done yet because the related test environments
need those OOT drivers. Here list the tests which have been done with
a test patch to remove the OOT drivers from the ISO temporarily.
PASS: Build sysinv OK.
PASS: Build ISO OK.
PASS: Install and boot up OK on an AIO-SX lab with std/rt kernel
by jenkins jobs.
Thanks M. Vefa Bicakci for the solution.
Story: 2011000
Task: 49365
Change-Id: I99fc88f87dfe55723d0e21780c39a759b8fa680a
Signed-off-by: Li Zhou
---
sysinv/sysinv/sysinv/sysinv/agent/node.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sysinv/sysinv/sysinv/sysinv/agent/node.py b/sysinv/sysinv/sysinv/sysinv/agent/node.py
index 4b75a11af7..822507eb01 100644
--- a/sysinv/sysinv/sysinv/sysinv/agent/node.py
+++ b/sysinv/sysinv/sysinv/sysinv/agent/node.py
@@ -362,10 +362,11 @@ class NodeOperator(object):
if files:
for file in files:
- with open(mydir + '/' + file, 'r') as f:
- if file.startswith("nr_hugepages"):
+ if file.startswith("nr_hugepages"):
+ with open(mydir + '/' + file, 'r') as f:
nr_hugepages = int(f.readline())
- if file.startswith("free_hugepages"):
+ if file.startswith("free_hugepages"):
+ with open(mydir + '/' + file, 'r') as f:
free_hugepages = int(f.readline())
total_hp_mb = total_hp_mb + int(nr_hugepages * size)