linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: linux-fsdevel@vger.kernel.org
Cc: "Oleg Nesterov" <oleg@redhat.com>,
	"Amir Goldstein" <amir73il@gmail.com>,
	"Aleksa Sarai" <cyphar@cyphar.com>,
	"Yu Watanabe" <watanabe.yu+github@gmail.com>,
	"Josef Bacik" <josef@toxicpanda.com>,
	"Jeff Layton" <jlayton@kernel.org>,
	"Jann Horn" <jannh@google.com>,
	"Luca Boccassi" <luca.boccassi@gmail.com>,
	"Alexander Mikhalitsyn" <alexander@mihalicyn.com>,
	linux-kernel@vger.kernel.org,
	"Alexander Viro" <viro@zeniv.linux.org.uk>,
	"Jan Kara" <jack@suse.cz>,
	"Lennart Poettering" <lennart@poettering.net>,
	"Mike Yuan" <me@yhndnzj.com>,
	"Zbigniew Jędrzejewski-Szmek" <zbyszek@in.waw.pl>,
	"Christian Brauner" <brauner@kernel.org>
Subject: [PATCH 20/22] selftests/coredump: ignore ENOSPC errors
Date: Tue, 28 Oct 2025 09:46:05 +0100	[thread overview]
Message-ID: <20251028-work-coredump-signal-v1-20-ca449b7b7aa0@kernel.org> (raw)
In-Reply-To: <20251028-work-coredump-signal-v1-0-ca449b7b7aa0@kernel.org>

If we crash multiple processes at the same time we may run out of space.
Just ignore those errors. They're not actually all that relevant for the
test.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
 tools/testing/selftests/coredump/coredump_socket_protocol_test.c | 4 ++++
 tools/testing/selftests/coredump/coredump_socket_test.c          | 5 +++--
 tools/testing/selftests/coredump/coredump_test_helpers.c         | 2 ++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/coredump/coredump_socket_protocol_test.c b/tools/testing/selftests/coredump/coredump_socket_protocol_test.c
index 566545e96d7f..d19b6717c53e 100644
--- a/tools/testing/selftests/coredump/coredump_socket_protocol_test.c
+++ b/tools/testing/selftests/coredump/coredump_socket_protocol_test.c
@@ -184,6 +184,8 @@ TEST_F(coredump, socket_request_kernel)
 
 			bytes_write = write(fd_core_file, buffer, bytes_read);
 			if (bytes_read != bytes_write) {
+				if (bytes_write < 0 && errno == ENOSPC)
+					continue;
 				fprintf(stderr, "socket_request_kernel: write to core file failed (read=%zd, write=%zd): %m\n",
 					bytes_read, bytes_write);
 				goto out;
@@ -1366,6 +1368,8 @@ TEST_F_TIMEOUT(coredump, socket_multiple_crashing_coredumps, 500)
 
 				bytes_write = write(fd_core_file, buffer, bytes_read);
 				if (bytes_read != bytes_write) {
+					if (bytes_write < 0 && errno == ENOSPC)
+						continue;
 					fprintf(stderr, "write failed for fd %d: %m\n", fd_core_file);
 					goto out;
 				}
diff --git a/tools/testing/selftests/coredump/coredump_socket_test.c b/tools/testing/selftests/coredump/coredump_socket_test.c
index 0a37d0456672..da558a0e37aa 100644
--- a/tools/testing/selftests/coredump/coredump_socket_test.c
+++ b/tools/testing/selftests/coredump/coredump_socket_test.c
@@ -158,8 +158,9 @@ TEST_F(coredump, socket)
 
 			bytes_write = write(fd_core_file, buffer, bytes_read);
 			if (bytes_read != bytes_write) {
-				fprintf(stderr, "socket test: write to core file failed (read=%zd, write=%zd): %m\n",
-					bytes_read, bytes_write);
+				if (bytes_write < 0 && errno == ENOSPC)
+					continue;
+				fprintf(stderr, "socket test: write to core file failed (read=%zd, write=%zd): %m\n", bytes_read, bytes_write);
 				goto out;
 			}
 		}
diff --git a/tools/testing/selftests/coredump/coredump_test_helpers.c b/tools/testing/selftests/coredump/coredump_test_helpers.c
index 65deb3cfbe1b..a6f6d5f2ae07 100644
--- a/tools/testing/selftests/coredump/coredump_test_helpers.c
+++ b/tools/testing/selftests/coredump/coredump_test_helpers.c
@@ -357,6 +357,8 @@ void process_coredump_worker(int fd_coredump, int fd_peer_pidfd, int fd_core_fil
 					goto done;
 				ssize_t bytes_write = write(fd_core_file, buffer, bytes_read);
 				if (bytes_write != bytes_read) {
+					if (bytes_write < 0 && errno == ENOSPC)
+						continue;
 					fprintf(stderr, "Worker: write() failed (read=%zd, write=%zd): %m\n",
 						bytes_read, bytes_write);
 					goto out;

-- 
2.47.3


  parent reply	other threads:[~2025-10-28  8:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28  8:45 [PATCH 00/22] coredump: cleanups & pidfd extension Christian Brauner
2025-10-28  8:45 ` [PATCH 01/22] pidfs: use guard() for task_lock Christian Brauner
2025-10-28  8:45 ` [PATCH 02/22] pidfs: fix PIDFD_INFO_COREDUMP handling Christian Brauner
2025-10-28  8:45 ` [PATCH 03/22] pidfs: add missing PIDFD_INFO_SIZE_VER1 Christian Brauner
2025-10-28  8:45 ` [PATCH 04/22] pidfs: add missing BUILD_BUG_ON() assert on struct pidfd_info Christian Brauner
2025-10-28  8:45 ` [PATCH 05/22] pidfd: add a new supported_mask field Christian Brauner
2025-10-28  8:45 ` [PATCH 06/22] pidfs: prepare to drop exit_info pointer Christian Brauner
2025-10-28  8:45 ` [PATCH 07/22] pidfs: drop struct pidfs_exit_info Christian Brauner
2025-10-28  8:45 ` [PATCH 08/22] pidfs: expose coredump signal Christian Brauner
2025-10-28  8:45 ` [PATCH 09/22] selftests/pidfd: update pidfd header Christian Brauner
2025-10-28  8:45 ` [PATCH 10/22] selftests/pidfd: add first supported_mask test Christian Brauner
2025-10-28  8:45 ` [PATCH 11/22] selftests/pidfd: add second " Christian Brauner
2025-10-28  8:45 ` [PATCH 12/22] selftests/coredump: split out common helpers Christian Brauner
2025-10-28  8:45 ` [PATCH 13/22] selftests/coredump: split out coredump socket tests Christian Brauner
2025-10-28  8:45 ` [PATCH 14/22] selftests/coredump: fix userspace client detection Christian Brauner
2025-10-28  8:46 ` [PATCH 15/22] selftests/coredump: fix userspace coredump " Christian Brauner
2025-10-28  8:46 ` [PATCH 16/22] selftests/coredump: handle edge-triggered epoll correctly Christian Brauner
2025-10-28  8:46 ` [PATCH 17/22] selftests/coredump: add debug logging to test helpers Christian Brauner
2025-10-28  8:46 ` [PATCH 18/22] selftests/coredump: add debug logging to coredump socket tests Christian Brauner
2025-10-28  8:46 ` [PATCH 19/22] selftests/coredump: add debug logging to coredump socket protocol tests Christian Brauner
2025-10-28  8:46 ` Christian Brauner [this message]
2025-10-28  8:46 ` [PATCH 21/22] selftests/coredump: add first PIDFD_INFO_COREDUMP_SIGNAL test Christian Brauner
2025-10-28  8:46 ` [PATCH 22/22] selftests/coredump: add second " Christian Brauner
2025-11-02 17:03 ` [PATCH 00/22] coredump: cleanups & pidfd extension Oleg Nesterov

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=20251028-work-coredump-signal-v1-20-ca449b7b7aa0@kernel.org \
    --to=brauner@kernel.org \
    --cc=alexander@mihalicyn.com \
    --cc=amir73il@gmail.com \
    --cc=cyphar@cyphar.com \
    --cc=jack@suse.cz \
    --cc=jannh@google.com \
    --cc=jlayton@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=lennart@poettering.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.boccassi@gmail.com \
    --cc=me@yhndnzj.com \
    --cc=oleg@redhat.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=watanabe.yu+github@gmail.com \
    --cc=zbyszek@in.waw.pl \
    /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;
as well as URLs for NNTP newsgroup(s).