From: Yohei Kojima <yk@y-koj.net>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: linux-kselftest@vger.kernel.org, netdev@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>
Subject: Re: [PATCH net-next v2 2/2] selftests: net: improve error handling in passive TFO test
Date: Wed, 14 Jan 2026 00:57:33 +0900 [thread overview]
Message-ID: <aWZrbRhat5mw1tnl@desktop.y-koj.net> (raw)
In-Reply-To: <607a0338-5e84-4aaf-b705-18dcd4aca05f@web.de>
On Tue, Jan 13, 2026 at 03:48:11PM +0100, Markus Elfring wrote:
> …
> > +++ b/tools/testing/selftests/net/tfo.c
> > @@ -82,8 +82,10 @@ static void run_server(void)
> …
> > if (read(connfd, buf, 64) < 0)
> > - perror("read()");
> > - fprintf(outfile, "%d\n", opt);
> > + error(1, errno, "read()");
> > +
> > + if (fprintf(outfile, "%d\n", opt) < 0)
> > + error(1, errno, "fprintf()");
> >
> > fclose(outfile);
> > close(connfd);
> …
>
> Why was error detection omitted for close() calls here so far?
Because I believe that checking the return value of fclose() would not
provide additional value in this test case, which is focused on testing
the behavior of passive TFO.
I understand that fclose() could fail there, but considering the
trade-off between test reliability and code complexity (which increases
review and maintenance costs), I think checking the return value there
does not provide benefits to justify the added complexity. In fact, as
far as I can see, none of the existing tests in selftests/net check the
fclose() return value.
Thank you,
Yohei
>
> https://pubs.opengroup.org/onlinepubs/9799919799/functions/fclose.html
>
> Regards,
> Markus
next prev parent reply other threads:[~2026-01-13 15:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 14:11 [PATCH net-next v2 0/2] selftests: net: improve error handling in passive TFO test Yohei Kojima
2026-01-13 14:11 ` [PATCH net-next v2 1/2] selftests: net: fix passive TFO test to fail if child processes failed Yohei Kojima
2026-01-13 14:11 ` [PATCH net-next v2 2/2] selftests: net: improve error handling in passive TFO test Yohei Kojima
2026-01-13 14:48 ` Markus Elfring
2026-01-13 15:57 ` Yohei Kojima [this message]
2026-01-14 8:33 ` Markus Elfring
2026-01-15 16:21 ` Yohei Kojima
2026-01-19 14:19 ` [PATCH net-next v2 0/2] " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aWZrbRhat5mw1tnl@desktop.y-koj.net \
--to=yk@y-koj.net \
--cc=Markus.Elfring@web.de \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox