mirror of
https://review.haiku-os.org/haiku
synced 2025-01-18 20:48:48 +01:00
3ecbb34240
The IORequest internally likes to deal with transferEndOffset not transferredBytes because of sub-requests potentially being prepared all at once (in some paths in the I/O scheduler), thus fTransferSize can get incremented in Advance() before we have actually executed that transfer. But external consumers much prefer just knowing transferredBytes not transferEndOffset. And many of them actually named their variables that (or "bytesTransferred") and just passed the transferEndOffset through to variables with that name! That's obviously wrong, and it's surprising it wasn't discovered before now. The problem was uncovered by repeated KDLs in PrecacheIO. That method used the "bytesTransferred" value as a count of pages transferred, which would then run past the end of the array if the transfer start offset was not 0 (which the majority of the time it would be, since this method gets called on the first mmap() of a file, probably before any pages are read in.) Most other consumers of this API did not check the value, it seems, or otherwise had some mitigating factor that prevented it from causing more problems. An exception is the page code, which may have spuriously considered writes as successful when they really weren't. May fix some of the "invalid concurrent access to page" KDLs. |
||
---|---|---|
.. | ||
build | ||
compatibility | ||
config | ||
cpp | ||
glibc | ||
libs | ||
os | ||
posix | ||
private | ||
tools |