lib/model, lib/ignores: Properly handle out of folder ignores and free space checks (fixes #4313, fixes #4314)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4318
This commit is contained in:
Audrius Butkevicius
2017-08-22 06:45:00 +00:00
committed by Jakob Borg
parent b8c249cddc
commit 0a96a1150b
3 changed files with 52 additions and 33 deletions

View File

@@ -2304,7 +2304,7 @@ func (m *Model) checkFreeSpace(req config.Size, fs fs.Filesystem) error {
}
if req.Percentage() {
freePct := (1 - float64(usage.Free)/float64(usage.Total)) * 100
freePct := (float64(usage.Free) / float64(usage.Total)) * 100
if err == nil && freePct < val {
return fmt.Errorf("insufficient space in %v %v: %f %% < %v", fs.Type(), fs.URI(), freePct, req)
}