Skip to content

Remove the optimization for zero fill pages after EOF and some other minor bug fixes - #199

Merged
hbirth merged 5 commits into
DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1from
hbirth:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1
Aug 20, 2026
Merged

Remove the optimization for zero fill pages after EOF and some other minor bug fixes#199
hbirth merged 5 commits into
DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1from
hbirth:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1

Conversation

@hbirth

@hbirth hbirth commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

This reverts commit 6462b69.

This has to be thought through better since done this way it will
make disabling request timeouts impossible since it will take the
hung task automaitcally on zero.

This led to request terminations during io500 bench testing
@hbirth hbirth changed the title Redfs ubuntu hwe 6.17.0 16.16 24.04.1 Remove the optimization for zero fill pages after EOF and some other minor bug fixes Aug 19, 2026
hbirth added 4 commits August 19, 2026 16:03
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.

Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
Read-modify-writes of blocks past the server EOF go back to reading:
the zero-fill needed fi->server_size verified against every recorded
write grant, and the verification GETATTRs are server traffic and
complexity the saved READs are not worth.  Partial pages 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, the
grant verification debt, and the zero-fill in
fuse_iomap_read_folio_range().

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 page, 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 pages at all.  Split the buffered write
(fuse_dlm_buffered_write()): cache only the page-aligned interior,
whole pages need no read-modify-write, and send the unaligned head and
tail through the existing writethrough path (fuse_perform_write()).  A
partial page is written byte-exact and left non-uptodate, so nothing is
read and neighbouring writers sharing a boundary page 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, and the pre-claimed i_size extension with its
reconciliation keeps working on the chunk total.  The read-modify-write
path stays functional for the rare unaligned restart of the interior
after a faulted user copy.

Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
@hbirth
hbirth force-pushed the redfs-ubuntu-hwe-6.17.0-16.16-24.04.1 branch from c27b63e to de4ddbe Compare August 20, 2026 11:04
@hbirth
hbirth merged commit 41b92e4 into DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1 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