Fix sized filesystem

If purging is enabled, overwriting a file with a file of the same
or smaller size will not result in an error.

It is now possible to change the purging mode on an existing sized
filesystem.
This commit is contained in:
Ingo Oppermann
2023-09-22 14:16:46 +02:00
parent 0f4c88be39
commit c3b63c4480
5 changed files with 68 additions and 9 deletions

View File

@@ -426,7 +426,7 @@ func (a *api) start() error {
} else {
a.memfs.SetMetadata("base", baseMemFS.String())
if sizedfs, ok := a.memfs.(fs.SizedFilesystem); ok {
sizedfs.Resize(cfg.Storage.Memory.Size * 1024 * 1024)
sizedfs.Resize(cfg.Storage.Memory.Size*1024*1024, cfg.Storage.Memory.Purge)
}
}