HomeFreeBSD

FIOSEEKHOLE/FIOSEEKDATA: correct consistency for bmap-based implementation

Description

FIOSEEKHOLE/FIOSEEKDATA: correct consistency for bmap-based implementation

Writes on UFS through a mapped region do not allocate disk blocks in
holes immediately. The blocks are allocated when the pages are paged out
first time.

This breaks the algorithm in vn_bmap_seekhole() and ufs_bmap_seekdata(),
because VOP_BMAP() reports hole for the place which already contains a
valid data.

Clean the pages before doing VOP_BMAP() in the affected functions. In
principle, we could clean less by only requesting clean starting from
the offset, but it is probably not very important.

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

Details

Provenance
kibAuthored on Feb 4 2023, 1:20 AM
Reviewer
asomers
Differential Revision
D38379: FIOSEEKHOLE/FIOSEEKDATA: correct constistency for bmap-based implementation
Parents
rGd9d5f2c042a5: cpuset: add --count
Branches
Unknown
Tags
Unknown