remove immutable flag also for subvols on directory storage
or else the removal of such templates (with rootfs size 0) fails Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
committed by
Fabian Grünbichler
parent
69e7407e45
commit
f5451f288d
@ -597,6 +597,12 @@ sub free_image {
|
||||
|
||||
my $path = $class->filesystem_path($scfg, $volname);
|
||||
|
||||
if ($isBase) {
|
||||
# try to remove immutable flag
|
||||
eval { run_command(['/usr/bin/chattr', '-i', $path]); };
|
||||
warn $@ if $@;
|
||||
}
|
||||
|
||||
if (defined($format) && ($format eq 'subvol')) {
|
||||
File::Path::remove_tree($path);
|
||||
} else {
|
||||
@ -606,12 +612,6 @@ sub free_image {
|
||||
return undef;
|
||||
}
|
||||
|
||||
if ($isBase) {
|
||||
# try to remove immutable flag
|
||||
eval { run_command(['/usr/bin/chattr', '-i', $path]); };
|
||||
warn $@ if $@;
|
||||
}
|
||||
|
||||
unlink($path) || die "unlink '$path' failed - $!\n";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user