mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH mptcp-net] selftests: mptcp: clean tmp files in simult_flows
@ 2021-08-24  8:47 Matthieu Baerts
  2021-08-24  8:59 ` Paolo Abeni
  2021-08-24  9:37 ` Matthieu Baerts
  0 siblings, 2 replies; 3+ messages in thread
From: Matthieu Baerts @ 2021-08-24  8:47 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts

'$cin' and '$sin' variables are local to a function: they are then not
available from the cleanup trap.

Instead, we need to use '$large' and '$small' that are not local and
defined just before setting the trap.

Without this patch, running this script in a loop might cause a:

  write: No space left on device

issue.

Fixes: 1a418cb8e888 ("mptcp: simult flow self-tests")
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---

Notes:
    I hit this problem when trying to reproduce issue #227.

 tools/testing/selftests/net/mptcp/simult_flows.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh
index fd63ebfe9a2b..910d8126af8f 100755
--- a/tools/testing/selftests/net/mptcp/simult_flows.sh
+++ b/tools/testing/selftests/net/mptcp/simult_flows.sh
@@ -22,8 +22,8 @@ usage() {
 
 cleanup()
 {
-	rm -f "$cin" "$cout"
-	rm -f "$sin" "$sout"
+	rm -f "$cout" "$sout"
+	rm -f "$large" "$small"
 	rm -f "$capout"
 
 	local netns
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH mptcp-net] selftests: mptcp: clean tmp files in simult_flows
  2021-08-24  8:47 [PATCH mptcp-net] selftests: mptcp: clean tmp files in simult_flows Matthieu Baerts
@ 2021-08-24  8:59 ` Paolo Abeni
  2021-08-24  9:37 ` Matthieu Baerts
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Abeni @ 2021-08-24  8:59 UTC (permalink / raw)
  To: Matthieu Baerts, mptcp

On Tue, 2021-08-24 at 10:47 +0200, Matthieu Baerts wrote:
> '$cin' and '$sin' variables are local to a function: they are then not
> available from the cleanup trap.
> 
> Instead, we need to use '$large' and '$small' that are not local and
> defined just before setting the trap.
> 
> Without this patch, running this script in a loop might cause a:
> 
>   write: No space left on device
> 
> issue.
> 
> Fixes: 1a418cb8e888 ("mptcp: simult flow self-tests")
> Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>

Many thanks for catching this!

Acked-by: Paolo Abeni <pabeni@redhat.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH mptcp-net] selftests: mptcp: clean tmp files in simult_flows
  2021-08-24  8:47 [PATCH mptcp-net] selftests: mptcp: clean tmp files in simult_flows Matthieu Baerts
  2021-08-24  8:59 ` Paolo Abeni
@ 2021-08-24  9:37 ` Matthieu Baerts
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Baerts @ 2021-08-24  9:37 UTC (permalink / raw)
  To: MPTCP Upstream

Hi Paolo,

On 24/08/2021 10:47, Matthieu Baerts wrote:
> '$cin' and '$sin' variables are local to a function: they are then not
> available from the cleanup trap.
> 
> Instead, we need to use '$large' and '$small' that are not local and
> defined just before setting the trap.
> 
> Without this patch, running this script in a loop might cause a:
> 
>   write: No space left on device
> 
> issue.

Thank you for your quick review!

Now in our tree:

- 5f14e01df498: selftests: mptcp: clean tmp files in simult_flows
- Results: e91aa69164c2..e4be38126ede

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-24  9:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-24  8:47 [PATCH mptcp-net] selftests: mptcp: clean tmp files in simult_flows Matthieu Baerts
2021-08-24  8:59 ` Paolo Abeni
2021-08-24  9:37 ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).