From fde179c2a2be4a4dfc811be927e48fb41b5251de Mon Sep 17 00:00:00 2001 From: jkellerer Date: Fri, 14 Sep 2018 11:23:08 +0200 Subject: [PATCH] Fixed #3373 - LVM: Backup failure on removed files Fixes a problem in IsBlockDevice(localPath) which throws an exception when a path that exists in the snapshot is removed from the disk during the backup. --- Duplicati/Library/Snapshots/LinuxSnapshot.cs | 26 ++++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/Duplicati/Library/Snapshots/LinuxSnapshot.cs b/Duplicati/Library/Snapshots/LinuxSnapshot.cs index 95e742cd8..26f853a0c 100644 --- a/Duplicati/Library/Snapshots/LinuxSnapshot.cs +++ b/Duplicati/Library/Snapshots/LinuxSnapshot.cs @@ -487,18 +487,28 @@ namespace Duplicati.Library.Snapshots /// The file or folder to examine public override bool IsBlockDevice(string localPath) { - var n = UnixSupport.File.GetFileType(SystemIOLinux.NormalizePath(localPath)); - switch (n) + try { - case UnixSupport.File.FileType.Directory: - case UnixSupport.File.FileType.Symlink: - case UnixSupport.File.FileType.File: + var n = UnixSupport.File.GetFileType(SystemIOLinux.NormalizePath(localPath)); + switch (n) + { + case UnixSupport.File.FileType.Directory: + case UnixSupport.File.FileType.Symlink: + case UnixSupport.File.FileType.File: + return false; + default: + return true; + } + } + catch + { + if (!System.IO.File.Exists(SystemIOLinux.NormalizePath(localPath))) return false; - default: - return true; + + throw; } } - + /// /// Gets a unique hardlink target ID ///