Skip to content

Commit

Permalink
possibly fix a bug in renameAndUpdateDiskUsage
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMure committed Apr 27, 2022
1 parent 6c3252c commit 26abf67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flatfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func (fs *Datastore) renameAndUpdateDiskUsage(tmpPath, path string) error {
fi, err := os.Stat(path)

// Destination exists, we need to discount it from diskUsage
if fs != nil && err == nil {
if fi != nil && err == nil {
atomic.AddInt64(&fs.diskUsage, -fi.Size())
} else if !os.IsNotExist(err) {
return err
Expand Down

0 comments on commit 26abf67

Please sign in to comment.