1. Teach buffer pager about bogus pages. They should be silently skipped.
2. Do not call into a vnode pager while leaving some pages from the same block as the current run, xbusy. This immediately deadlocks if pager needs to instantiate the buffer.
3. Do not double-unbusy on error.
4. Ensure that iodone() is called on erorrs from local pagers.
5. Wait for all in-flight async io runs to complete before unwiring pages on error.
Also, it
1. expands comments explaining nuances which are hard to see even after re-reading the code
2. add specific malloc type so that leaks are more easily seen that e.g. just wired or busy pages leak
3. order headers alphabetically
4. some style.
PR: 244713 [1, 2]
There are more issues, I limited the scope to interaction with the pagers.
Even there, there are more issues, most serious is explained in XXXKIB comment.
The patch passed stress2 sendfile subset, but I asked Peter for more run time.