Repository navigation
Linux 6.12:fuse: do not zero-fill another node's bytes past a stale E… - #248
Merged
Merged
Conversation
yongzech
commented
Oct 10, 2026
Collaborator
…OF under DLM With the writeback cache and DLM, ior-hard (47008-byte transfers into one shared file from several clients) reads back zeros in pages that ranks on two client nodes share. Under DLM the local i_size is only this node's view: a write refreshes STATX_MODE, not the size, and the grant does not carry it. Once another node has extended the file, two paths trust the stale size and zero that node's bytes, and writeback sends the zeros over them once this node's i_size covers the folio. fuse_write_begin() skips the read-modify-write READ for a partial folio that starts at or past the local i_size and zero-fills it instead. Under DLM, read it. The write grant is page-aligned and was granted only after the previous holder's revoke flushed the page, so the read is coherent, and a true hole still reads back as zeros. It adds no new kind of wait under the LOCKED range: the same READ is already issued for every partial folio inside the known size. The cost is at most two READs per write beyond the local i_size. fuse_zero_eof_gap() zeroes the cached old-EOF folio from the local i_size to its end before an extending write, assuming the server's side of that gap is a hole. Under DLM a folio read from the server can hold another node's bytes there, and the read above makes that common. The bytes this function exists to clear can only come from a shared writable mapping, so add FUSE_I_SHARED_WRITE_MMAP, set in fuse_file_mmap() for such a mapping and never cleared, and skip the zeroing under DLM with the writeback cache unless it is set. A file both mapped shared-writable and written from several nodes keeps the old behavioour. Signed-off-by: <Yong Ze Chen> <yochen@ddn.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yongzech
requested review from
achhenderson,
cding-ddn,
hazhou-ddn and
hbirth
October 10, 2026 08:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.