Page MenuHomeFreeBSD

tmpfs: check residence in data_locked
ClosedPublic

Authored by dougm on Wed, Oct 2, 6:32 PM.
Tags
None
Referenced Files
F98809359: D46879.id144156.diff
Fri, Oct 4, 8:14 PM
F98675692: D46879.diff
Fri, Oct 4, 7:46 AM
Unknown Object (File)
Thu, Oct 3, 2:20 PM
Unknown Object (File)
Thu, Oct 3, 1:29 AM
Subscribers

Details

Summary

tmpfs_seek_data_locked should return the offset of the first page either resident in memory or in swap, but may return an offset to a nonresident page. Check for residence to fix that.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dougm requested review of this revision.Wed, Oct 2, 6:32 PM
dougm created this revision.
sys/fs/tmpfs/tmpfs_vnops.c
2111

If we encounter an invalid page, I believe we still need to consult the swap pager before proceeding to the next pindex.

dougm added a subscriber: alc.

Try to address feedback from @markj and @alc.

This revision is now accepted and ready to land.Fri, Oct 4, 4:10 AM
alc added inline comments.
sys/fs/tmpfs/tmpfs_vnops.c
2111

if m->pindex != p, testing vm_page_any_valid(m) needn't happen at all if p_swp == p or m->pindex >= p_swp. Otherwise, we were repeating it on the same page in the first iteration of the below loop.

Avoid checking the same page for validity twice, at the cost of finding the next page when it might turn out not to matter.

This revision now requires review to proceed.Fri, Oct 4, 6:58 AM
This revision is now accepted and ready to land.Fri, Oct 4, 7:22 AM
This revision was automatically updated to reflect the committed changes.