Page MenuHomeFreeBSD

Don't mark pages as valid if reading the contents from disk fails.
ClosedPublic

Authored by chs on Jun 4 2020, 10:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 19 2024, 4:00 PM
Unknown Object (File)
Oct 13 2024, 6:49 AM
Unknown Object (File)
Oct 13 2024, 6:49 AM
Unknown Object (File)
Oct 13 2024, 6:49 AM
Unknown Object (File)
Oct 13 2024, 6:36 AM
Unknown Object (File)
Sep 27 2024, 7:30 PM
Unknown Object (File)
Sep 27 2024, 11:34 AM
Unknown Object (File)
Sep 11 2024, 10:22 AM
Subscribers

Details

Summary

While investigating other sendfile issues with I/O error handling,
I noticed that if an async I/O from sendfile fails, then the sendfile code
would avoid sending the stale to the socket, but the pages which could not
be read were still marked valid and left in memory, and then the stale contents
of these pages can be accessed by any normal method such as read().
vnode_pager_generic_getpages_done() indeed marks the pages valid
without checking for errors, so this patch just skips marking the pages
valid if the I/O failed. Future attempts to access such pages will
notice that they are not marked valid and try to read them from disk again.

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, 10:06 PM
kib added inline comments.
sys/vm/vnode_pager.c
1174 ↗(On Diff #72692)

I believe some lines become too long after one more level of indent there.

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