diff --git a/src/fdcache_entity.cpp b/src/fdcache_entity.cpp index 2c21772..67fbd36 100644 --- a/src/fdcache_entity.cpp +++ b/src/fdcache_entity.cpp @@ -1498,6 +1498,10 @@ ssize_t FdEntity::Write(const char* bytes, off_t start, size_t size) S3FS_PRN_WARN("Not enough local storage to cache write request: [path=%s][fd=%d][offset=%lld][size=%zu]", path.c_str(), fd, static_cast(start), size); return -ENOSPC; // No space left on device } + if ((start + static_cast(size)) <= S3fsCurl::GetMultipartSize()) { + S3FS_PRN_WARN("Not enough local storage to cache write request till multipart upload can start: [path=%s][fd=%d][offset=%lld][size=%zu]", path.c_str(), fd, static_cast(start), size); + return -ENOSPC; // No space left on device + } if(0 != (result = NoCachePreMultipartPost())){ S3FS_PRN_ERR("failed to switch multipart uploading with no cache(errno=%d)", result); return result;