5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2025-01-06 21:17:37 +03:00

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 <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2023-04-17 16:15:06 +02:00
parent c153bf020f
commit 52620f86bd

View File

@ -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);
}