Page MenuHomeFreeBSD

tmpfs: check residence in data_locked
ClosedPublic

Authored by dougm on Oct 2 2024, 6:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 1:20 AM
Unknown Object (File)
Sat, Oct 26, 12:51 PM
Unknown Object (File)
Sat, Oct 12, 5:28 PM
Unknown Object (File)
Tue, Oct 8, 9:24 AM
Unknown Object (File)
Oct 5 2024, 5:05 AM
Unknown Object (File)
Oct 4 2024, 11:21 PM
Unknown Object (File)
Oct 4 2024, 11:18 PM
Unknown Object (File)
Oct 4 2024, 10:07 PM
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.Oct 2 2024, 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.Oct 4 2024, 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.Oct 4 2024, 6:58 AM
This revision is now accepted and ready to land.Oct 4 2024, 7:22 AM
This revision was automatically updated to reflect the committed changes.