-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix disk usage calculations when too large file is created
Previously if you created file having larger initial contents than the free space in the fake filesystem, the disk usage counter was decreased by the size of the initial contents possibly resulting in negative usage. Basically the issue was that when ChangeDiskUsage is called with size larger than the amount of free space, space usage is not changed but an error is raised. Due to an exception, CreateFile removes the created object that results in new call to ChangeDiskUsage with negative size of the object. Previously the object's size was set before ChangeDiskUsage was called and then when the object was being removed the object's already set size was used to reduce the filesystem usage (even though that size was never added to the usage).
- Loading branch information
1 parent
1ab5e47
commit a125519
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters