public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Filip Schauer <f.schauer@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH common 3/8] tools: add mount_setattr syscall
Date: Mon, 23 Feb 2026 14:04:49 +0100	[thread overview]
Message-ID: <20260223130706.90972-4-f.schauer@proxmox.com> (raw)
In-Reply-To: <20260223130706.90972-1-f.schauer@proxmox.com>

The mount_setattr syscall can change attributes of an existing mount.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
---
 src/PVE/Syscall.pm | 1 +
 src/PVE/Tools.pm   | 9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/src/PVE/Syscall.pm b/src/PVE/Syscall.pm
index a5753d9..53e0f4b 100644
--- a/src/PVE/Syscall.pm
+++ b/src/PVE/Syscall.pm
@@ -27,6 +27,7 @@ BEGIN {
         renameat2 => &SYS_renameat2,
         open_tree => &SYS_open_tree,
         move_mount => &SYS_move_mount,
+        mount_setattr => &SYS_mount_setattr,
         fsopen => &SYS_fsopen,
         fsconfig => &SYS_fsconfig,
         fsmount => &SYS_fsmount,
diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
index d226fb6..5b15874 100644
--- a/src/PVE/Tools.pm
+++ b/src/PVE/Tools.pm
@@ -1682,6 +1682,15 @@ sub move_mount($$$$$) {
     );
 }
 
+sub mount_setattr($$$$$$$) {
+    my ($dirfd, $path, $flags, $attr_set, $attr_clr, $propagation, $userns_fd) = @_;
+
+    my $attr = pack("Q4", $attr_set, $attr_clr, $propagation, $userns_fd);
+    return 0 ==
+        syscall(&PVE::Syscall::mount_setattr, int($dirfd), $path, int($flags), $attr,
+            length($attr));
+}
+
 sub fsopen($$) {
     my ($fsname, $flags) = @_;
     return PVE::Syscall::file_handle_result(syscall(&PVE::Syscall::fsopen, $fsname, int($flags)));
-- 
2.47.3





  parent reply	other threads:[~2026-02-23 13:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 13:04 [PATCH common/container/manager 0/8] implement per-mountpoint uid/gid mapping Filip Schauer
2026-02-23 13:04 ` [PATCH common 1/8] tools: export O_CLOEXEC constant Filip Schauer
2026-02-23 13:04 ` [PATCH common 2/8] syscall: add missing mount attribute constants Filip Schauer
2026-02-23 13:04 ` Filip Schauer [this message]
2026-02-23 13:04 ` [PATCH container 4/8] namespaces: relax prototype of run_in_userns Filip Schauer
2026-02-23 13:04 ` [PATCH container 5/8] namespaces: refactor run_in_userns Filip Schauer
2026-02-23 13:04 ` [PATCH container 6/8] namespaces: add helper to create user namespace from idmap Filip Schauer
2026-02-23 13:04 ` [PATCH container 7/8] implement per-mountpoint uid/gid mapping Filip Schauer
2026-02-23 13:04 ` [PATCH manager 8/8] ui: lxc/MPEdit: add "idmap" option Filip Schauer

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=20260223130706.90972-4-f.schauer@proxmox.com \
    --to=f.schauer@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 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