]> git.proxmox.com Git - pve-container.git/commitdiff
fix #3917: Ignore fstrim failure in pct fstrim
authorMarkus Frank <m.frank@proxmox.com>
Fri, 11 Mar 2022 11:59:57 +0000 (12:59 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 16 Mar 2022 16:05:04 +0000 (17:05 +0100)
With "noerr => 1" the function does not abort, when one of the
mountpoints is not fstrim compatible like zfs (has its own trim).
I do not think it is necessary to warn or error, because fstrim
tells when something is not trimmable and aborts.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
src/PVE/CLI/pct.pm

index 462917bdbd83b7f40779dd80cd2bb87b1d80b0c7..23793ee6482ec3743c42ce14eb117c7f5f16fa8e 100755 (executable)
@@ -792,7 +792,7 @@ __PACKAGE__->register_method ({
                $path = $mp->{mp};
                return if $param->{'ignore-mountpoints'} && $name =~ /^mp\d+/;
                my $cmd = ["fstrim", "-v", "$rootdir$path"];
-               PVE::Tools::run_command($cmd);
+               PVE::Tools::run_command($cmd, noerr => 1);
            });
        };
        warn $@ if $@;