Sync to ubuntu-hwe 6.17 - #200
Merged
Merged
Conversation
The re-lock after waiting on the coherency gate funnels its failure through the common exit, but written still holds the positive count generic_write_checks() returned, so the failed write claims full success without having dirtied a single page, and generic_write_sync() runs over a range that was never written. Put the error into written, the way the killpriv failure path above does. The ubuntu-hwe variant of this function never had the problem: it carries the count in err and leaves written zero until the data is actually written. Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
The append grant is taken at a sampled i_size, but the exclusive inode lock does not pin it: attribute replies move i_size under fi->lock alone. generic_write_checks() then rewrites ki_pos to the fresher i_size and the write lands past the granted range, dirtying the cache without DLM coverage. The in-gate re-validation checks the stale range and cannot catch it. Request the lock again for the final ki_pos when it moved, and let dlm_pos track it so the in-gate re-validation guards the range the write really lands in. [hbi: rhel10 port of ubuntu-hwe c4a1a4241930; the failure is funnelled through written, matching the error flow of this variant] Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
Read-modify-writes of folios past the server EOF go back to reading: the zero-fill trusts fi->server_size under a recorded write grant, but every source of the bound can predate the grant, and the grant request is what makes a competing node flush. Data flushed in that window sits above a stale bound and gets zeroed over. Keeping the bound honest would take a server EOF observation after every recorded write grant, and those GETATTRs are server traffic and complexity the saved READs are not worth. Partial folios of expanding writes will be sent as separate FUSE_WRITE requests instead, which needs no read-modify-write at all. Remove the fi->server_size bound with its grow and shrink sites and the zero-fill in fuse_write_begin(). [hbi: rhel10 counterpart of ubuntu-hwe 98690625686d; the grant verification machinery was never ported here, so only the zero-fill in fuse_write_begin() and the fi->server_size bound are removed] Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
With the expansion zero-fill gone, every unaligned buffered write under DLM pays a read-modify-write READ per partial folio, and past the server EOF that READ returns zero bytes: a wasted round trip for data that cannot exist. The write path cannot tell the wasted READ from a needed one without trusting a bound the grant may predate. Do not complete partial folios at all. Split the buffered write (fuse_dlm_buffered_write()): cache only the page-aligned interior, whole folios need no read-modify-write, and send the unaligned head and tail through the existing writethrough path (fuse_perform_write()). A partial folio is written byte-exact and left non-uptodate, so nothing is read and neighbouring writers sharing a boundary folio accumulate their bytes on the server. A sub-page write with no aligned interior goes fully through. The DLM write lock is taken over the whole range before i_rwsem, so all chunks are covered. The read-modify-write in fuse_write_begin() stays functional for the partial folios that still reach it, like the buffered fallback of a direct write. [hbi: rewritten 2026-08-19 to match ubuntu-hwe 4b782b76eddd: the WARN_ON_ONCE guard in fuse_write_begin() is gone (the RMW path stays functional, e.g. for the buffered fallback of a direct write) and the interior goes through generic_perform_write on this base] Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
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.
sync to ubuntu-hwe semantically