Description
The filesystem storage backend does not currently verify that there is enough disk space before writing an object. Large uploads could fail partway through, leaving partial files on disk.
Location
src/storage/filesystem.rs:152
Details
The put() method should check available disk space before starting a write and reject the request with an appropriate S3 error if the object would not fit.
Things to consider:
- Use
statvfs or equivalent to check free space
- Account for the incoming
Content-Length header
- Consider a configurable low-watermark threshold
- Handle the case where
Content-Length is unknown (chunked uploads)
- Clean up partial writes on failure (may already be handled)
Acceptance Criteria
Description
The filesystem storage backend does not currently verify that there is enough disk space before writing an object. Large uploads could fail partway through, leaving partial files on disk.
Location
src/storage/filesystem.rs:152Details
The
put()method should check available disk space before starting a write and reject the request with an appropriate S3 error if the object would not fit.Things to consider:
statvfsor equivalent to check free spaceContent-LengthheaderContent-Lengthis unknown (chunked uploads)Acceptance Criteria
put()InsufficientStorageor similar) when space is low