vm_ooffset_t is now unsigned. Remove some tests for negative values,
or make other adjustments accordingly.
Details
Details
- Reviewers
kib alc markj - Commits
- rS365886: vm_ooffset_t is now unsigned
Dead code is hard to test.
Diff Detail
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 33221 Build 30564: arc lint + arc unit
Event Timeline
sys/kern/vfs_vnops.c | ||
---|---|---|
2620–2630 | I'm not sure how to update this comment. Suggestions welcome. |
sys/fs/tmpfs/tmpfs_subr.c | ||
---|---|---|
178 | I think this should be size_t, and before subtraction, the check should be made to return 0. | |
sys/kern/vfs_vnops.c | ||
2620–2630 | I believe the comment is still valid, it depends on the vm_ooffset_t being type-punned for off_t. Check below (foff > OFF_MAX-size) ensures that we do not require fs to mmap pass OFF_MAX. |
sys/kern/vfs_vnops.c | ||
---|---|---|
2620–2630 | Makes sense. Thank you. |
sys/fs/tmpfs/tmpfs_subr.c | ||
---|---|---|
183 | You perform two reads of tmpfs_pages_reserved. If user changes the sysctl meanime, you might get overflow on the second calculation. |
sys/fs/tmpfs/tmpfs_subr.c | ||
---|---|---|
183 | To make this pedantically correct I believe you have to use atomic_load_long(&tmpfs_pages_reserved). There is nothing preventing the compiler from loading tmpfs_pages_reserved twice. |