From 52620f86bd6d46cd7d667d5c03c811245acc3b44 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 17 Apr 2023 16:15:06 +0200 Subject: [PATCH] memory info: add regex anchor to avoid false positives if arcstat gets re-ordered or new field that includes 'size' gets added at the top Signed-off-by: Thomas Lamprecht --- src/PVE/ProcFSTools.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm index 43ba490..f5677b7 100644 --- a/src/PVE/ProcFSTools.pm +++ b/src/PVE/ProcFSTools.pm @@ -309,7 +309,7 @@ sub read_meminfo { $res->{memshared} = int($spages) * 4096; my $arc_stats = eval { PVE::Tools::file_get_contents("/proc/spl/kstat/zfs/arcstats") }; - if ($arc_stats && $arc_stats =~ m/size\s+\d+\s+(\d+)/m) { + if ($arc_stats && $arc_stats =~ m/^size\s+\d+\s+(\d+)$/m) { $res->{arcsize} = int($1); }