[pve-devel] [PATCH storage 1/6] dir plugin: update notes: don't attempt to remove non-existent notes

Fabian Ebner f.ebner at proxmox.com
Fri Sep 17 15:02:21 CEST 2021


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/Storage/DirPlugin.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Storage/DirPlugin.pm b/PVE/Storage/DirPlugin.pm
index 2267f11..0423e5f 100644
--- a/PVE/Storage/DirPlugin.pm
+++ b/PVE/Storage/DirPlugin.pm
@@ -109,7 +109,7 @@ sub update_volume_notes {
 
     if (defined($notes) && $notes ne '') {
 	PVE::Tools::file_set_contents($path, $notes);
-    } else {
+    } elsif (-e $path) {
 	unlink $path or die "could not delete notes - $!\n";
     }
     return;
-- 
2.30.2





More information about the pve-devel mailing list