Commit Graph
1 Commits
Author SHA1 Message Date
5e796fa985 mount: keep a file's inline content when it is written to or resized (#13009)
* mount: keep a file's inline content when it is written to or resized

A small file the filer keeps inside its entry (-saveToFilerLimit, or
?saveInside=true on the upload) has its bytes in the entry's content and
no chunks. A mount dropped the content at the first write to the file, or
copy into it, and published the write's chunk alone: the bytes the write
did not cover read as zeros from then on, for an append as for two bytes
in the middle. A change of size left the content as it was. Grown, the
file read no further than its content on the mount and as zeros through
the filer; cut and grown again, it had the bytes that were cut off back.

The content now becomes a write of the handle's own, older than the one
about to change the file, and is flushed with it as a chunk
(bufferInlineContent: Write, CopyFileRange, Fallocate). SetAttr cuts it to
a smaller size, and stores it as a chunk before the file grows past it
(resizeInlineContent).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* mount: store resized inline content in chunks of the mount's chunk size

A file that grows past its inline content had the content stored as one
chunk, whatever its length, where a buffered write is split at the
mount's chunk size: content longer than a volume server takes in one
upload could not be stored, and the file could not grow.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: MapleWhiteZZZ <18653045+MapleWhiteZZZ@users.noreply.github.com>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-25 17:29:28 -08:00