public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container v2] sync_container_namespace: skip virtual filesystems
@ 2020-09-18 12:16 Stoiko Ivanov
  2020-09-22  8:48 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2020-09-18 12:16 UTC (permalink / raw)
  To: pve-devel

skip additional virtual filesystems.

the list is taken from a running debian container's /proc/mounts

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
v1 -> v2:
* changed the non-anchored unwieldy regex to a hash based on Thomas' suggestion
  - Thanks!

 src/PVE/LXC.pm | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index b3e3581..9c150d9 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1103,11 +1103,24 @@ my $do_syncfs = sub {
     my $mountdata = do { local $/ = undef; <$socket> };
     close $socket;
 
+    my %nosyncfs = (
+	cgroup => 1,
+	cgroup2 => 1,
+	devtmpfs => 1,
+	devpts => 1,
+	'fuse.lxcfs' => 1,
+	fusectl => 1,
+	mqueue => 1,
+	proc => 1,
+	sysfs => 1,
+	tmpfs => 1,
+    );
+
     # Now sync all mountpoints...
     my $mounts = PVE::ProcFSTools::parse_mounts($mountdata);
     foreach my $mp (@$mounts) {
 	my ($what, $dir, $fs) = @$mp;
-	next if $fs eq 'fuse.lxcfs';
+	next if $nosyncfs{$fs};
 	eval { PVE::Tools::sync_mountpoint($dir); };
 	warn $@ if $@;
     }
-- 
2.20.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-22  8:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 12:16 [pve-devel] [PATCH container v2] sync_container_namespace: skip virtual filesystems Stoiko Ivanov
2020-09-22  8:48 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal