all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH container v2] sync_container_namespace: skip virtual filesystems
Date: Fri, 18 Sep 2020 14:16:21 +0200	[thread overview]
Message-ID: <20200918121621.24584-1-s.ivanov@proxmox.com> (raw)

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





             reply	other threads:[~2020-09-18 12:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18 12:16 Stoiko Ivanov [this message]
2020-09-22  8:48 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200918121621.24584-1-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal