kernel: Add assert in IOBuffer::SetVecs() that the passed length is the actual length.

These are, at present, triggered on rare invocations of vfs_read_pages.

See #15912.
This commit is contained in:
Augustin Cavalier 2020-04-27 00:50:34 -04:00
parent 8ff2f81f6b
commit d939cacf6b

View File

@ -126,6 +126,14 @@ IOBuffer::SetVecs(generic_size_t firstVecOffset, const generic_io_vec* vecs,
fLength = length;
fPhysical = (flags & B_PHYSICAL_IO_REQUEST) != 0;
fUser = !fPhysical && IS_USER_ADDRESS(vecs[0].base);
#if KDEBUG
generic_size_t actualLength = 0;
for (size_t i = 0; i < fVecCount; i++)
actualLength += fVecs[i].length;
ASSERT(actualLength == fLength);
#endif
}