From 7fa43dad717f35206c39489ac44fb9f0aef627f6 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 19 May 2017 16:37:07 -0500 Subject: [PATCH] Make auto expand loop if necessary --- src/ox/fs/filesystem.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ox/fs/filesystem.hpp b/src/ox/fs/filesystem.hpp index 72ab885b3..f41b2c35d 100644 --- a/src/ox/fs/filesystem.hpp +++ b/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); }