From ddb3263031940daaf4298b3075391d992a08057c Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Thu, 30 Sep 2021 13:42:04 +0200 Subject: [PATCH] dir plugin: update notes: don't fail if file is already removed Signed-off-by: Fabian Ebner --- PVE/Storage/DirPlugin.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVE/Storage/DirPlugin.pm b/PVE/Storage/DirPlugin.pm index 3eeec98..1fcb8ce 100644 --- a/PVE/Storage/DirPlugin.pm +++ b/PVE/Storage/DirPlugin.pm @@ -2,8 +2,11 @@ package PVE::Storage::DirPlugin; use strict; use warnings; + use Cwd; use File::Path; +use POSIX; + use PVE::Storage::Plugin; use PVE::JSONSchema qw(get_standard_option); @@ -111,7 +114,7 @@ sub update_volume_notes { if (defined($notes) && $notes ne '') { PVE::Tools::file_set_contents($path, $notes); } else { - unlink $path or die "could not delete notes - $!\n"; + unlink $path or $! == ENOENT or die "could not delete notes - $!\n"; } return; }