Also:
tmpfs: change return type of tmpfs_pages_check_avail() to bool
vn_bmap_seekhole: check that passed offset is non-negative
Details
- Reviewers
markj - Commits
- rGe9adbcdf2e80: tmpfs: report minimal hole size
rG934bfc128efa: Add vm_page_any_valid()
rG85cff1455a8c: tmpfs: implement FIOSEEKDATA and FIOSEEKHOLE
rG5bd45b2ba3f2: swap_pager_find_least(): assert that the function is called on the right object…
rG33ce17883506: vn_bmap_seekhole: check that passed offset is non-negative
rG8b32cdec9cd5: tmpfs: order include files alphabetically
rG7f055843ac50: tmpfs: change return type of tmpfs_pages_check_avail() to bool
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
sys/fs/tmpfs/tmpfs_vnops.c | ||
---|---|---|
1852 | You could optimize for the case where no pages are swapped: check if the swap block trie is empty, and if so use vm_page_find_least(). With a bit more work, the swap pager could find the next block after a given pindex. I remember that we needed similar optimizations to UFS to avoid pathological behaviour found by syzkaller. It would create a giant sparse file, then FIOSEEKDATA would spend eternity checking each block one by one in an unkillable loop. | |
1853 | I'd avoid accessing vm_page fields like this, and instead write m != NULL && !vm_page_none_valid(m)). And maybe add vm_page_any_valid() so that we don't need a double negative. |
Make tmpfs_seek_data_locked() loop-less (I do not see a way to avoid walking the object page queue in tmpfs_seek_hole_locked()).
Add vm_page_any_valid() and use helpers in more places.
Yes, for SEEKHOLE we need to check each index.
Add vm_page_any_valid() and use helpers in more places.
Thanks.
sys/fs/tmpfs/tmpfs_vnops.c | ||
---|---|---|
1841 |