]> git.proxmox.com Git - pve-container.git/commitdiff
volume mount: make adding noacl more efficient master
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 18 Apr 2024 13:48:46 +0000 (15:48 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 18 Apr 2024 13:48:47 +0000 (15:48 +0200)
Move this special case handling inside the code branch where we
already got the format available to avoid calling parse_volname twice.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/LXC.pm

index 53ad41e0b72fc1bdd2f0080af5ea15b1cbe3a4ac..400cf4ffadea594731c43d5f10deeac146cb1e37 100644 (file)
@@ -1828,11 +1828,7 @@ sub __mountpoint_mount {
 
     if ($acl) {
        push @$optlist, 'acl';
-    } elsif (defined($acl) && $storage) { # acl is explicitly set to false
-       # Since kernel 6.1 the noacl mount option got removed for ext4, which is used for all raw volumes
-       # FIXME: just ignore and log_warn with acl=0 in Proxmox VE 9 (warn also in pve8to9!)
-       my $format = (PVE::Storage::parse_volname($storage_cfg, $volid))[6];
-       push @$optlist, 'noacl' if $format ne 'raw';
+       # NOTE: the else branch is handled below
     }
 
     my $optstring = join(',', @$optlist);
@@ -1853,6 +1849,12 @@ sub __mountpoint_mount {
        my ($vtype, undef, undef, undef, undef, $isBase, $format) =
            PVE::Storage::parse_volname($storage_cfg, $volid);
 
+       if (defined($acl) && !$acl) {
+           # Does having this really makes sense or should we drop it with a future major release?
+           # Kernel 6.1 removed the noacl mount option for ext4, which is used for all raw volumes.
+           push @$optlist, 'noacl' if $format ne 'raw';
+       }
+
        $format = 'iso' if $vtype eq 'iso'; # allow to handle iso files
 
        if ($format eq 'subvol') {