From 0754a5cd72bf6040234e14430b2eafeb46ffd0d0 Mon Sep 17 00:00:00 2001 From: Jojo-1000 <33495614+Jojo-1000@users.noreply.github.com> Date: Sun, 16 Jul 2023 19:24:37 +0200 Subject: [PATCH] Ignore File backend quota if total size is zero. Mono sometimes reports the total size of unknown file systems as zero. Because it should be obvious when the size is actually zero, ignore the quota in this case. --- Duplicati/Library/Backend/File/FileBackend.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Duplicati/Library/Backend/File/FileBackend.cs b/Duplicati/Library/Backend/File/FileBackend.cs index a2b005458..79c410e26 100644 --- a/Duplicati/Library/Backend/File/FileBackend.cs +++ b/Duplicati/Library/Backend/File/FileBackend.cs @@ -234,7 +234,7 @@ namespace Duplicati.Library.Backend } else { - systemIO.FileCopy(sourceFilePath, targetFilePath, true); + systemIO.FileCopy(sourceFilePath, targetFilePath, true); if (m_verifyDestinationLength) VerifyMatchingSize(targetFilePath, sourceFilePath); } @@ -347,7 +347,12 @@ namespace Duplicati.Library.Backend System.IO.DriveInfo driveInfo = this.GetDrive(); if (driveInfo != null) { - return new QuotaInfo(driveInfo.TotalSize, driveInfo.AvailableFreeSpace); + // Check that the total space is above 0, because Mono sometimes reports 0 for unknown file systems + // If the drive actually has a total size of 0, this should be obvious immediately due to write errors + if (driveInfo.TotalSize > 0) + { + return new QuotaInfo(driveInfo.TotalSize, driveInfo.AvailableFreeSpace); + } } if (Platform.IsClientWindows)