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
This commit is contained in:
Carsten Grohmann 2021-03-09 21:22:54 +01:00 committed by Andrew Gaul
parent b589ebec23
commit ef079f4e94

View File

@ -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<long long int>(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<ssize_t>(result);