mirror of
https://github.com/opnsense/src.git
synced 2026-04-15 14:29:58 -04:00
getmntinfo(3) is designed around a relatively static or slow growing set of current mounts. It tried to detect a race with somewhat concurrent mount and re-call getfsstat(2) in that case, looping indefinitely. It also allocated space for a single extra mount as slop. In the case where the user has a large number of mounts and is adding them at a rapid pace, it fell over. This patch makes two functional changes: 1. Allocate even more slop. Double whatever the last getfsstat(2) returned. 2. Abort and return some known results after looping a few times (arbitrarily, 3). If the list is constantly changing, we can't guarantee we return a full result to the user at any point anyways. While here, add very basic functional tests for getmntinfo(3) to the libc suite. PR: 221743 Submitted by: Peter Eriksson <peter AT ifm.liu.se> (earlier version) Sponsored by: Dell EMC Isilon |
||
|---|---|---|
| .. | ||
| execve | ||
| posix_spawn | ||
| arc4random_test.c | ||
| dlopen_empty_test.c | ||
| fmtcheck_test.c | ||
| fmtmsg_test.c | ||
| fnmatch_test.c | ||
| fnmatch_testcases.h | ||
| fpclassify2_test.c | ||
| ftw_test.c | ||
| getmntinfo_test.c | ||
| glob2_test.c | ||
| Makefile | ||
| Makefile.depend | ||
| popen_test.c | ||
| posix_spawn_test.c | ||
| realpath2_test.c | ||
| test-fnmatch.c | ||
| wordexp_test.c | ||