From ef079f4e94a66b394fe993a8c1fef98802510cdb Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Tue, 9 Mar 2021 21:22:54 +0100 Subject: [PATCH] Don't ignore nomultipart when storage is low When the temporary storage filled up, the old implementation uploaded all data with multipart uploads, even if "nomultipart" was set. The new implementation emits a warning and returns -ENOSPC instead. Fixes #1595 --- src/fdcache_entity.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fdcache_entity.cpp b/src/fdcache_entity.cpp index fa4dc6c..1943fba 100644 --- a/src/fdcache_entity.cpp +++ b/src/fdcache_entity.cpp @@ -1481,6 +1481,10 @@ ssize_t FdEntity::Write(const char* bytes, off_t start, size_t size) } }else{ // no enough disk space + if (nomultipart) { + 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(0 != (result = NoCachePreMultipartPost())){ S3FS_PRN_ERR("failed to switch multipart uploading with no cache(errno=%d)", result); return static_cast(result);