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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user