diff --git a/deps/ox/src/ox/fs/filesystem.hpp b/deps/ox/src/ox/fs/filesystem.hpp index 72ab885b..f41b2c35 100644 --- a/deps/ox/src/ox/fs/filesystem.hpp +++ b/deps/ox/src/ox/fs/filesystem.hpp @@ -551,8 +551,10 @@ int FileSystemTemplate::write(const char *path, void *buffer #endif template int FileSystemTemplate::write(uint64_t inode, void *buffer, uint64_t size, uint8_t fileType) { - if (m_autoExpand && m_store->spaceNeeded(size) > m_store->available()) { - expand(this->size() * 2); + if (m_autoExpand) { + while (m_store->spaceNeeded(size) > m_store->available()) { + expand(this->size() * 2); + } } return m_store->write(inode, buffer, size, fileType); }