All of lore.kernel.org
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: matttbe@kernel.org
Cc: martineau@kernel.org, geliang@kernel.org, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	willemb@google.com, horms@kernel.org, liyonglong@chinatelecom.cn,
	shuah@kernel.org, fw@strlen.de, netdev@vger.kernel.org,
	mptcp@lists.linux.dev, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next 08/10] selftests: mptcp: sockopt: drop unreachable FIN accounting
Date: Sat, 05 Dec 2026 22:04:13 +0000	[thread overview]
Message-ID: <179650825388.3148.5503592824533064994@kernel.org> (raw)
In-Reply-To: <20261204-net-next-mptcp-misc-feat-7-5-v1-8-1449de51adae@kernel.org>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message presents a change with no effect on the test
  as a fix for a problem someone could hit.
- [Low] The new xerror("unexpected EOF, total %lu, len %lu\n", total,
  len) in connect_one_server() and the rewritten xerror("total %lu, len…

--

selftests: mptcp: sockopt: drop unreachable FIN accounting

This commit removes the eof flag and the unreachable DATA_FIN "total += 1"
adjustment in connect_one_server(). When read() returns 0 inside the
receive loop, the code now calls xerror() directly. The post-loop
length mismatch message is simplified to match.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/637

> This issue has been reported by Sashiko and not seen in CI environments.
> Yet, it could be visible, especially when the test is launched manually.
>
> Fixes: ce9979129a0b ("selftests: mptcp: add mptcp getsockopt test cases")

[Severity: Low]
Is this paragraph accurate for this patch?

Before the change, read() returning 0 set eof and broke out of the loop
while total was still below len, and len is at least 128. That means the
check right after the loop always fired:

    if (total != len)
        xerror("total %lu, len %lu eof %d\n", total, len, eof);

xerror() is __noreturn, so the process already exited with status 1 on an
early EOF. After the patch, xerror() is called directly inside the loop
and the result is the same.

The commit message itself says the removed "total += 1" could never run.
So there doesn't seem to be any symptom that "could be visible" when the
test is launched manually.

The sentence looks like it was carried over from the previous patch in
the series, "selftests: mptcp: sockopt: pass total bytes to
do_getsockopts". That patch fixed an assertion failure that could really
be hit.

Could this be described as a cleanup with no functional change instead?
The "could be visible" sentence, and possibly the Fixes tag, could then be
dropped so stable tooling doesn't treat this as a flake fix.

> diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
> index 7b4ccbe10ae18..10bef56acc6c9 100644
> --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
> +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c

[ ... ]

> @@ -610,16 +609,15 @@ static void connect_one_server(int fd, int pipefd)
>  		ret = read(fd, buf2 + total, sizeof(buf2) - total);
>  		if (ret < 0)
>  			die_perror("read");
> -		if (ret == 0) {
> -			eof = true;
> -			break;
> -		}
> +		if (ret == 0)
> +			xerror("unexpected EOF, total %lu, len %lu\n",
> +			       total, len);
>  
>  		total += ret;
>  	} while (total < len);
>  
>  	if (total != len)
> -		xerror("total %lu, len %lu eof %d\n", total, len, eof);
> +		xerror("total %lu, len %lu\n", total, len);

[Severity: Low]
This isn't a bug, but total and len are size_t in connect_one_server().
Should these two messages use %zu, like the existing xerror() call in
do_getsockopt_tcp_info()?

    xerror("tcpi_bytes_sent %" PRIu64 ", want %zu. tcpi_bytes_received %" PRIu64 ", want %zu",

xerror() has no printf format attribute, so the compiler won't flag the
mismatch.

Also, xerror() already appends its own newline:

    vfprintf(stderr, fmt, ap);
    ...
    fputc('\n', stderr);

so the trailing "\n" in both formats prints an extra blank line. Could the
"\n" be dropped from the new message and the rewritten one?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204-net-next-mptcp-misc-feat-7-5-v1-0-1449de51adae%40kernel.org

  reply	other threads:[~2026-12-05 22:04 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 21:44 [PATCH net-next 00/10] mptcp: misc improvements for v7.5 Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 01/10] mptcp: pm: work on a copy of the received RM_ADDR list Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 02/10] mptcp: pm: don't drop an RM_ADDR behind a pending one Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 03/10] mptcp: pm: don't drop an RM_ADDR because of an ADD_ADDR Matthieu Baerts (NGI0)
2026-12-05 21:45   ` sashiko-bot
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 04/10] mptcp: pm: keep an RM_ADDR when computing the MSS Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 05/10] mptcp: annotate lockless access to msk->scaling_ratio Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 06/10] selftests: mptcp: join: dump stats with right title Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 07/10] selftests: mptcp: sockopt: pass total bytes to do_getsockopts Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko
2026-12-04 21:44 ` [PATCH net-next 08/10] selftests: mptcp: sockopt: drop unreachable FIN accounting Matthieu Baerts (NGI0)
2026-12-05 22:04   ` netdev-bot+sashiko [this message]
2026-12-04 21:44 ` [PATCH net-next 09/10] mptcp: add msk_is_mptcp() helper Matthieu Baerts (NGI0)
2026-12-04 21:44 ` [PATCH net-next 10/10] selftests: mptcp: print stats before socket closure Matthieu Baerts (NGI0)

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=179650825388.3148.5503592824533064994@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=fw@strlen.de \
    --cc=geliang@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liyonglong@chinatelecom.cn \
    --cc=martineau@kernel.org \
    --cc=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=willemb@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.