freebsd-src/sys/ufs
Konstantin Belousov 3b6056204d 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
2023-02-04 20:32:07 +02:00
..
ffs ffs_syncvnode(): avoid a LoR for SU 2023-01-14 20:28:11 +02:00
ufs FIOSEEKHOLE/FIOSEEKDATA: correct consistency for bmap-based implementation 2023-02-04 20:32:07 +02:00