From fea0a2e1c3c7045c4d20e3030c24624dd7b77b94 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 --- deps/ox/src/ox/fs/filesystem.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deps/ox/src/ox/fs/filesystem.hpp b/deps/ox/src/ox/fs/filesystem.hpp index 72ab885b3..f41b2c35d 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); }