From 717f70b763644f1a7f6c2ced9bcc05e56c7da7f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 5 Sep 2018 11:37:09 +0200 Subject: [PATCH] fix #1897: bump MAX_MOUNT_POINTS to 256 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit and filter list of possible mountpoint names by currently used ones before iterating instead of in the loop body. Signed-off-by: Fabian Grünbichler --- src/PVE/LXC/Config.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index d49b674..7c10f4d 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -16,7 +16,7 @@ my $lock_handles = {}; my $lockdir = "/run/lock/lxc"; mkdir $lockdir; mkdir "/etc/pve/nodes/$nodename/lxc"; -my $MAX_MOUNT_POINTS = 10; +my $MAX_MOUNT_POINTS = 256; my $MAX_UNUSED_DISKS = $MAX_MOUNT_POINTS; # BEGIN implemented abstract methods from PVE::AbstractConfig @@ -1268,9 +1268,9 @@ sub mountpoint_names { sub foreach_mountpoint_full { my ($class, $conf, $reverse, $func, @param) = @_; - foreach my $key ($class->mountpoint_names($reverse)) { + my $mps = [ grep { defined($conf->{$_}) } $class->mountpoint_names($reverse) ]; + foreach my $key (@$mps) { my $value = $conf->{$key}; - next if !defined($value); my $mountpoint = $key eq 'rootfs' ? $class->parse_ct_rootfs($value, 1) : $class->parse_ct_mountpoint($value, 1); next if !defined($mountpoint); -- 2.39.2