Re: pty09: Cap RLIMIT_NOFILE-based slave PTY opens

[email protected]
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
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

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.