Skip to content

Sync to ubuntu-hwe 6.17 - #200

Merged
hbirth merged 5 commits into
DDNStorage:redfs-rhel10_0from
hbirth:redfs-rhel10_0
Aug 20, 2026
Merged

Sync to ubuntu-hwe 6.17#200
hbirth merged 5 commits into
DDNStorage:redfs-rhel10_0from
hbirth:redfs-rhel10_0

Conversation

@hbirth

@hbirth hbirth commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

sync to ubuntu-hwe semantically

hbirth added 4 commits August 19, 2026 11:31
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>
@hbirth hbirth changed the title Redfs rhel10 0 Sync to ubuntu-hwe 6.17 Aug 19, 2026
Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
@hbirth
hbirth merged commit 4f352ab into DDNStorage:redfs-rhel10_0 Aug 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant