Commit 503e7dc
fix(vfss3): stop rejecting all uploads when no quota is set
CheckAvailableDiskSpace returns maxsize = fs.MaxFileSize() when no
disk quota is configured. s3VFS.MaxFileSize() returned 0 (intended as
"no per-file limit"), but that meant CreateFile's redundant
`if newsize > maxsize` post-check fired for every non-empty upload —
making any file fail with ErrFileTooBig → HTTP 413 → "storage full"
in the UI, even on an empty volume.
Two changes:
- Return -1 from MaxFileSize() to match aferoVFS's convention for
"no limit". This makes the streaming-time check in
s3FileCreation.Write (`f.maxsize >= 0 && f.w > f.maxsize`) skip
correctly when no quota is in effect.
- Drop the redundant post-CheckAvailableDiskSpace `newsize > maxsize`
check from CreateFile and CopyFileFromOtherFS — the function
already returns the right error when relevant.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a33bc8f commit 503e7dc
1 file changed
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
| |||
703 | 704 | | |
704 | 705 | | |
705 | 706 | | |
706 | | - | |
| 707 | + | |
707 | 708 | | |
708 | 709 | | |
709 | 710 | | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | 711 | | |
714 | 712 | | |
715 | 713 | | |
| |||
0 commit comments