HomeFreeBSD

vnode_pager_generic_putpages(): correctly handle clean block at EOF

Description

vnode_pager_generic_putpages(): correctly handle clean block at EOF

The loop 'skip clean blocks' checking for the clean blocks in the dirty
pages might end up setting the in_hole to true when exactly at EOF at
the middle of the block, without advancing the prev_offset value. Then
the next block is not dirty, and next_offset is clipped back to poffset
+ maxsize, equal to prev_offset, failing the assertion.

Instead of asserting prev_offset < next_offset, we must skip the write.

Reported by: asomers
PR: 276191
Reviewed by: alc, markj
Tested by: asomers
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43358

Details

Provenance
kibAuthored on Jan 8 2024, 1:21 PM
Reviewer
alc
Differential Revision
D43358: vnode_pager_generic_putpages(): correctly handle clean block at EOF
Parents
rGd9b1f6fbf993: netlink: fix bug with socket buffer character counter underflow
Branches
Unknown
Tags
Unknown