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.
This commit is contained in:
Jojo-1000
2023-07-16 19:24:37 +02:00
parent 8af1dbb6fd
commit 0754a5cd72
@@ -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)