mirror of https://github.com/torvalds/linux.git
selftests/coredump: ignore ENOSPC errors
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. Link: https://patch.msgid.link/20251028-work-coredump-signal-v1-20-ca449b7b7aa0@kernel.org Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
408a0ed9ee
commit
32ae33f796
|
|
@ -184,6 +184,8 @@ TEST_F(coredump, socket_request_kernel)
|
||||||
|
|
||||||
bytes_write = write(fd_core_file, buffer, bytes_read);
|
bytes_write = write(fd_core_file, buffer, bytes_read);
|
||||||
if (bytes_read != bytes_write) {
|
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",
|
fprintf(stderr, "socket_request_kernel: write to core file failed (read=%zd, write=%zd): %m\n",
|
||||||
bytes_read, bytes_write);
|
bytes_read, bytes_write);
|
||||||
goto out;
|
goto out;
|
||||||
|
|
@ -1366,6 +1368,8 @@ TEST_F_TIMEOUT(coredump, socket_multiple_crashing_coredumps, 500)
|
||||||
|
|
||||||
bytes_write = write(fd_core_file, buffer, bytes_read);
|
bytes_write = write(fd_core_file, buffer, bytes_read);
|
||||||
if (bytes_read != bytes_write) {
|
if (bytes_read != bytes_write) {
|
||||||
|
if (bytes_write < 0 && errno == ENOSPC)
|
||||||
|
continue;
|
||||||
fprintf(stderr, "write failed for fd %d: %m\n", fd_core_file);
|
fprintf(stderr, "write failed for fd %d: %m\n", fd_core_file);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -158,8 +158,9 @@ TEST_F(coredump, socket)
|
||||||
|
|
||||||
bytes_write = write(fd_core_file, buffer, bytes_read);
|
bytes_write = write(fd_core_file, buffer, bytes_read);
|
||||||
if (bytes_read != bytes_write) {
|
if (bytes_read != bytes_write) {
|
||||||
fprintf(stderr, "socket test: write to core file failed (read=%zd, write=%zd): %m\n",
|
if (bytes_write < 0 && errno == ENOSPC)
|
||||||
bytes_read, bytes_write);
|
continue;
|
||||||
|
fprintf(stderr, "socket test: write to core file failed (read=%zd, write=%zd): %m\n", bytes_read, bytes_write);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -357,6 +357,8 @@ void process_coredump_worker(int fd_coredump, int fd_peer_pidfd, int fd_core_fil
|
||||||
goto done;
|
goto done;
|
||||||
ssize_t bytes_write = write(fd_core_file, buffer, bytes_read);
|
ssize_t bytes_write = write(fd_core_file, buffer, bytes_read);
|
||||||
if (bytes_write != 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",
|
fprintf(stderr, "Worker: write() failed (read=%zd, write=%zd): %m\n",
|
||||||
bytes_read, bytes_write);
|
bytes_read, bytes_write);
|
||||||
goto out;
|
goto out;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue