[LTP] pty09: Cap RLIMIT_NOFILE-based slave PTY opens
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Tue Jul 14 10:06:28 CEST 2026
Hi Runli,
On Tue, 14 Jul 2026, Runli wrote:
> pty09: Cap RLIMIT_NOFILE-based slave PTY opens
> + if (max_pid_num > MAX_SLAVE_OPENS) {
> + max_pid_num = MAX_SLAVE_OPENS;
> + tst_res(TINFO, "Number of pids is too large, capped at: %u",
> + max_pid_num);
> + }
The value being capped is derived from RLIMIT_NOFILE (open file descriptor
slots), not process IDs. "Number of pids is too large" describes the wrong
resource.
The commit message itself uses the accurate term ("slave opens"). Suggest
aligning the TINFO message with that:
tst_res(TINFO, "Number of slave opens is too large, capped at: %u",
max_pid_num);
Pre-existing issue: the containing function count_avail_pid() and its local
variable max_pid_num carry the same "pid" misnomer for what is really an
open-fd-slot count. Not introduced by this patch, but worth noting.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list