[pve-devel] [PATCH container] fix #5761: add the "discard" mount option

Fiona Ebner f.ebner at proxmox.com
Thu Oct 24 13:46:17 CEST 2024


Am 09.10.24 um 16:22 schrieb Filip Schauer:
> Introduce the "discard" mount option for rootfs and mount points. This
> ensures that unused container volume blocks are discarded from the
> underlying storage backend when deleting files within the container.
> 
> Signed-off-by: Filip Schauer <f.schauer at proxmox.com>

Reviewed-by: Fiona Ebner <f.ebner at proxmox.com>
Tested-by: Fiona Ebner <f.ebner at proxmox.com>

However, this misses the UI part or you can get non-editable volumes there.

> ---
>  src/PVE/LXC/Config.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
> index ce64c4c..e980f8a 100644
> --- a/src/PVE/LXC/Config.pm
> +++ b/src/PVE/LXC/Config.pm
> @@ -311,7 +311,7 @@ sub __snapshot_rollback_get_unused {
>  cfs_register_file('/lxc/', \&parse_pct_config, \&write_pct_config);
>  
>  
> -my $valid_mount_option_re = qr/(noatime|lazytime|nodev|nosuid|noexec)/;
> +my $valid_mount_option_re = qr/(discard|lazytime|noatime|nodev|noexec|nosuid)/;
>  
>  sub is_valid_mount_option {
>      my ($option) = @_;




More information about the pve-devel mailing list