[pve-devel] [PATCH container] honor acl setting with zfs
Wolfgang Bumiller
w.bumiller at proxmox.com
Thu Apr 14 09:53:02 CEST 2016
---
Seems better than documenting that it doesn't work ;-)
It's time for mountpoint_mount() to stop growing... we need to
refactor some more pieces in there.
src/PVE/LXC.pm | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index fe97d31..ea68b71 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -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;
}
--
2.1.4
More information about the pve-devel
mailing list