From 0c0be8e413960bedb6f7c2e38b2f6396ac727963 Mon Sep 17 00:00:00 2001 From: Stoiko Ivanov Date: Fri, 18 Sep 2020 14:16:21 +0200 Subject: [PATCH] sync_container_namespace: skip virtual filesystems skip additional virtual filesystems. the list is taken from a running debian container's /proc/mounts Signed-off-by: Stoiko Ivanov --- 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.39.2