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:
committed by
Jakob Borg
parent
b8c249cddc
commit
0a96a1150b
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user