]> git.proxmox.com Git - pve-container.git/commitdiff
honor acl setting with zfs
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 14 Apr 2016 07:53:02 +0000 (09:53 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 21 Apr 2016 08:40:46 +0000 (10:40 +0200)
debian/changelog
src/PVE/LXC.pm

index 8486c5f0966758efeffc0fe33d35cae210761871..c63467cbc65d7af2ddffe8c21b785a89b79d217b 100644 (file)
@@ -8,6 +8,8 @@ pve-container (1.0-61) unstable; urgency=medium
 
   * Debian: correctly setup getty service on systemd based containers
 
+  * honor acl setting with zfs
+
  -- Proxmox Support Team <support@proxmox.com>  Wed, 20 Apr 2016 11:25:34 +0200
 
 pve-container (1.0-60) unstable; urgency=medium
index fe97d31ee5c0f7376c2161f00aabf36b4caed82d..ea68b710eb75bbc43ce6c2b1f416207d211ff13a 100644 (file)
@@ -1039,8 +1039,9 @@ sub mountpoint_mount {
     die "unknown snapshot path for '$volid'" if !$storage && defined($snapname);
 
     my $optstring = '';
-    if (defined($mountpoint->{acl})) {
-       $optstring .= ($mountpoint->{acl} ? 'acl' : 'noacl');
+    my $acl = $mountpoint->{acl};
+    if (defined($acl)) {
+       $optstring .= ($acl ? 'acl' : 'noacl');
     }
     my $readonly = $mountpoint->{ro};
 
@@ -1067,6 +1068,12 @@ sub mountpoint_mount {
                        die "cannot mount subvol snapshots for storage type '$scfg->{type}'\n";
                    }
                } else {
+                   if (defined($acl) && $scfg->{type} eq 'zfspool') {
+                       my $acltype = ($acl ? 'acltype=posixacl' : 'acltype=noacl');
+                       my (undef, $name) = PVE::Storage::parse_volname($storage_cfg, $volid);
+                       $name .= "\@$snapname" if defined($snapname);
+                       PVE::Tools::run_command(['zfs', 'set', $acltype, "$scfg->{pool}/$name"]);
+                   }
                    bindmount($path, $mount_path, $readonly, @extra_opts);
                    warn "cannot enable quota control for bind mounted subvolumes\n" if $quota;
                }