mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-08 15:44:11 +00:00
Ensuring multipart size even when storage is low
When the temporary storage was full, the old implementation started an upload even if there was not enough data to completely fill the minimum multipart size or fill the user-selected multipart size. The new implementation ensures the minimum multipart size by forcing the user-selected multipart size. Fixes #1591
This commit is contained in:
parent
4b69d4b1bb
commit
9bf525ee7a
@ -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<long long int>(start), size);
|
||||
return -ENOSPC; // No space left on device
|
||||
}
|
||||
if ((start + static_cast<off_t>(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<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 result;
|
||||
|
Loading…
Reference in New Issue
Block a user