* [pve-devel] [PATCH v2 container] fix #4846: Avoid the outdated noacl mount option on ext4
@ 2024-02-23 10:48 Filip Schauer
2024-04-11 13:44 ` Fabian Grünbichler
0 siblings, 1 reply; 6+ messages in thread
From: Filip Schauer @ 2024-02-23 10:48 UTC (permalink / raw)
To: pve-devel
Do not use the 'noacl' mount option when mounting a container disk with
an ext4 file system. The option was removed from the kernel in commit
2d544ec923db
The ext4 detection is based on $do_format in alloc_disk.
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
---
src/PVE/LXC.pm | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 7883cfb..6810601 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -1835,8 +1835,26 @@ sub __mountpoint_mount {
}
my $acl = $mountpoint->{acl};
- if (defined($acl)) {
- push @$optlist, ($acl ? 'acl' : 'noacl');
+
+ if ($acl) {
+ push @$optlist, 'acl';
+ } else {
+ my $noacl = 1;
+
+ if ($storage) {
+ my $scfg = PVE::Storage::storage_config($storage_cfg, $storage);
+
+ # Avoid the outdated 'noacl' mount option on ext4 file systems
+ if ($scfg->{content}->{rootdir} && $scfg->{path}) {
+ $noacl = ($scfg->{type} eq 'btrfs' && $scfg->{quotas});
+ } elsif ($scfg->{type} eq 'zfspool') {
+ $noacl = 1;
+ } elsif ($scfg->{content}->{rootdir}) {
+ $noacl = 0;
+ }
+ }
+
+ push @$optlist, 'noacl' if $noacl;
}
my $optstring = join(',', @$optlist);
--
2.39.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [pve-devel] [PATCH v2 container] fix #4846: Avoid the outdated noacl mount option on ext4
2024-02-23 10:48 [pve-devel] [PATCH v2 container] fix #4846: Avoid the outdated noacl mount option on ext4 Filip Schauer
@ 2024-04-11 13:44 ` Fabian Grünbichler
2024-04-17 14:38 ` Filip Schauer
2024-04-18 8:17 ` Thomas Lamprecht
0 siblings, 2 replies; 6+ messages in thread
From: Fabian Grünbichler @ 2024-04-11 13:44 UTC (permalink / raw)
To: Proxmox VE development discussion
On February 23, 2024 11:48 am, Filip Schauer wrote:
> Do not use the 'noacl' mount option when mounting a container disk with
> an ext4 file system. The option was removed from the kernel in commit
> 2d544ec923db
>
> The ext4 detection is based on $do_format in alloc_disk.
>
> Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
> ---
> src/PVE/LXC.pm | 22 ++++++++++++++++++++--
> 1 file changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
> index 7883cfb..6810601 100644
> --- a/src/PVE/LXC.pm
> +++ b/src/PVE/LXC.pm
> @@ -1835,8 +1835,26 @@ sub __mountpoint_mount {
> }
>
> my $acl = $mountpoint->{acl};
> - if (defined($acl)) {
> - push @$optlist, ($acl ? 'acl' : 'noacl');
> +
> + if ($acl) {
> + push @$optlist, 'acl';
> + } else {
> + my $noacl = 1;
> +
> + if ($storage) {
> + my $scfg = PVE::Storage::storage_config($storage_cfg, $storage);
> +
> + # Avoid the outdated 'noacl' mount option on ext4 file systems
> + if ($scfg->{content}->{rootdir} && $scfg->{path}) {
> + $noacl = ($scfg->{type} eq 'btrfs' && $scfg->{quotas});
I am not sure this is correct.. or rather, wouldn't it be simpler to say
if $storage && $format eq 'raw' => no noacl ?
if we get complains that somebody did something non-standard (i.e.,
manually formatted a raw volume using a different filesystem), we can
always think about adding support for that (e.g., via some "fs=XX"
property on the mountpoint that allows us to handle it here, although I
am not even sure if we *want* to support that ;)).
> + } elsif ($scfg->{type} eq 'zfspool') {
> + $noacl = 1;
> + } elsif ($scfg->{content}->{rootdir}) {
> + $noacl = 0;
> + }
> + }
> +
> + push @$optlist, 'noacl' if $noacl;
> }
>
> my $optstring = join(',', @$optlist);
> --
> 2.39.2
>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [pve-devel] [PATCH v2 container] fix #4846: Avoid the outdated noacl mount option on ext4
2024-04-11 13:44 ` Fabian Grünbichler
@ 2024-04-17 14:38 ` Filip Schauer
2024-04-18 8:17 ` Thomas Lamprecht
1 sibling, 0 replies; 6+ messages in thread
From: Filip Schauer @ 2024-04-17 14:38 UTC (permalink / raw)
To: pve-devel
On 11/04/2024 15:44, Fabian Grünbichler wrote:
> I am not sure this is correct.. or rather, wouldn't it be simpler to say
>
> if $storage && $format eq 'raw' => no noacl ?
>
> if we get complains that somebody did something non-standard (i.e.,
> manually formatted a raw volume using a different filesystem), we can
> always think about adding support for that (e.g., via some "fs=XX"
> property on the mountpoint that allows us to handle it here, although I
> am not even sure if we*want* to support that ;)).
yeah, I simplified it in patch v3:
https://lists.proxmox.com/pipermail/pve-devel/2024-April/063227.html
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [pve-devel] [PATCH v2 container] fix #4846: Avoid the outdated noacl mount option on ext4
2024-04-11 13:44 ` Fabian Grünbichler
2024-04-17 14:38 ` Filip Schauer
@ 2024-04-18 8:17 ` Thomas Lamprecht
2024-04-18 8:48 ` Fabian Grünbichler
1 sibling, 1 reply; 6+ messages in thread
From: Thomas Lamprecht @ 2024-04-18 8:17 UTC (permalink / raw)
To: Proxmox VE development discussion, Fabian Grünbichler
Am 11/04/2024 um 15:44 schrieb Fabian Grünbichler:
> if $storage && $format eq 'raw' => no noacl ?
shouldn't this branch be taken if the format is _not_ raw, as only in that
case it might not use ext4?
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [pve-devel] [PATCH v2 container] fix #4846: Avoid the outdated noacl mount option on ext4
2024-04-18 8:17 ` Thomas Lamprecht
@ 2024-04-18 8:48 ` Fabian Grünbichler
2024-04-18 9:22 ` Thomas Lamprecht
0 siblings, 1 reply; 6+ messages in thread
From: Fabian Grünbichler @ 2024-04-18 8:48 UTC (permalink / raw)
To: Proxmox VE development discussion, Thomas Lamprecht
On April 18, 2024 10:17 am, Thomas Lamprecht wrote:
> Am 11/04/2024 um 15:44 schrieb Fabian Grünbichler:
>> if $storage && $format eq 'raw' => no noacl ?
>
> shouldn't this branch be taken if the format is _not_ raw, as only in that
> case it might not use ext4?
>
if the format is raw (presumed ext4), don't set 'noacl'
- I think that is correct? we want to avoid 'noacl' for ext4..
note the double negation (no noacl) ;)
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [pve-devel] [PATCH v2 container] fix #4846: Avoid the outdated noacl mount option on ext4
2024-04-18 8:48 ` Fabian Grünbichler
@ 2024-04-18 9:22 ` Thomas Lamprecht
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Lamprecht @ 2024-04-18 9:22 UTC (permalink / raw)
To: Fabian Grünbichler, Proxmox VE development discussion
Am 18/04/2024 um 10:48 schrieb Fabian Grünbichler:
> On April 18, 2024 10:17 am, Thomas Lamprecht wrote:
>> Am 11/04/2024 um 15:44 schrieb Fabian Grünbichler:
>>> if $storage && $format eq 'raw' => no noacl ?
>>
>> shouldn't this branch be taken if the format is _not_ raw, as only in that
>> case it might not use ext4?
>>
>
> if the format is raw (presumed ext4), don't set 'noacl'
> - I think that is correct? we want to avoid 'noacl' for ext4..
>
> note the double negation (no noacl) ;)
yeah, OK, the double negation got me confused here and in
Filip's v3, thanks for clearing this up.
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-04-18 9:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-23 10:48 [pve-devel] [PATCH v2 container] fix #4846: Avoid the outdated noacl mount option on ext4 Filip Schauer
2024-04-11 13:44 ` Fabian Grünbichler
2024-04-17 14:38 ` Filip Schauer
2024-04-18 8:17 ` Thomas Lamprecht
2024-04-18 8:48 ` Fabian Grünbichler
2024-04-18 9:22 ` Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox