Page MenuHomeFreeBSD

Fix hang due to missing unbusy in sendfile when an async data I/O fails.
ClosedPublic

Authored by chs on Jun 4 2020, 9:49 PM.
Tags
None
Referenced Files
F171599266: D25136.id72691.diff
Sat, Sep 12, 1:11 AM
F171544788: D25136.id72691.diff
Fri, Sep 11, 4:34 PM
F171544747: D25136.id72757.diff
Fri, Sep 11, 4:34 PM
F171544276: D25136.diff
Fri, Sep 11, 4:29 PM
Unknown Object (File)
Sun, Sep 6, 7:42 AM
Unknown Object (File)
Thu, Aug 27, 6:25 AM
Unknown Object (File)
Sat, Aug 22, 1:52 PM
Unknown Object (File)
Sat, Aug 22, 1:52 PM
Subscribers

Details

Summary

r359473 removed the page unbusy logic from sendfile_iodone() because when
vm_pager_get_pages_async() would return an error after failing to start
the async I/O (eg. because VOP_BMAP failed), sendfile_swapin() would also
unbusy the pages, and it was wrong to unbusy twice. However this breaks
the case where vm_pager_get_pages_async() succeeds in starting an async I/O
and the async I/O is what fails. In this case, sendfile_iodone() must
unbusy the pages, and because sendfile_iodone() doesn't know which case
it is in, sendfile_iodone() must always unbusy pages and relookup pages
which have been substituted with bogus_page, which in turn means that
sendfile_swapin() must never do unbusy or relookup for pages which have
been given to vm_pager_get_pages_async(), even if there is an error.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

chs requested review of this revision.Jun 4 2020, 9:49 PM
kib added inline comments.
sys/kern/kern_sendfile.c
531 ↗(On Diff #72691)

This i no longer full recovery. it is something like 'the rest of full recovery, other parts were already done by sendfile_iodone completions'

This revision is now accepted and ready to land.Jun 4 2020, 11:01 PM