[LTP] [PATCH v2] unshare03.c: Add test coverage for dup_fd() failure handling in unshare_fd()
Wei Gao
wegao@suse.com
Tue Mar 4 05:03:22 CET 2025
On Mon, Mar 03, 2025 at 11:47:34AM +0100, Andrea Cervesato wrote:
> Hi!
>
> > +
> > + SAFE_FILE_SCANF(FS_NR_OPEN, "%d", &nr_open);
> Here we can print the number of open file descriptors, using tst_res(), to
> help debugging.
> > +
> > + SAFE_FILE_PRINTF(FS_NR_OPEN, "%d", nr_open + 1024);
>
> In the previous version I made a mistake in the review. The original test is
> using /proc/sys/fs/nr_open to set limits first, then it reads back them from
> the same file in order to have a starting limit. This is probably needed due
> to the kernel configurations. So please bring back the
> SAFE_GETRLIMIT(RLIMIT_NOFILE, &rlimit); line I asked to remove. Sorry for
> that.
>
> Also, if we are going to use new increments, we need to update the next
> increments as well according to the previous ones. So feel free to leave it
> as it was before.
>
> I must have been distracted that day :-)
No problem at all :)
I have sent new patch, feedback me if any misunderstanding.
>
>
> The rest looks ok.
>
> Andrea
>
More information about the ltp
mailing list