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
F82090830: D25138.id.diff
Thu, Apr 25, 10:13 AM
Unknown Object (File)
Sun, Apr 21, 8:47 AM
Unknown Object (File)
Dec 20 2023, 8:38 PM
Unknown Object (File)
Dec 8 2023, 2:54 PM
Unknown Object (File)
Oct 12 2023, 9:09 AM
Unknown Object (File)
Sep 7 2023, 10:20 AM
Unknown Object (File)
Sep 7 2023, 10:20 AM
Unknown Object (File)
Sep 7 2023, 10:17 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