[pve-devel] applied: [PATCH storage] remove immutable flag also for subvols on directory storage

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Mar 10 09:26:25 CET 2017


both for stable-4 and master

On Wed, Mar 01, 2017 at 12:03:40PM +0100, Dominik Csapak wrote:
> or else the removal of such templates (with rootfs size 0) fails
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  PVE/Storage/Plugin.pm | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm
> index 6e73547..31b8541 100644
> --- a/PVE/Storage/Plugin.pm
> +++ b/PVE/Storage/Plugin.pm
> @@ -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";
>      }
>      
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list