Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
systemd: force coredump to use LZ4 compression
Azure Watson cannot handle ZSTD compression, so force Mariner 2 systemd-coredump to always use LZ4 compression.
- Loading branch information
1 parent
7ac5290
commit 592d1ea
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
SPECS/systemd/mariner-2-force-use-of-lz4-for-coredump.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
diff -urpN systemd-stable-250.3/src/coredump/coredump.c b/src/coredump/coredump.c | ||
--- systemd-stable-250.3/src/coredump/coredump.c 2024-03-15 15:10:52.619059443 -0400 | ||
+++ b/src/coredump/coredump.c 2024-03-15 15:10:05.255079220 -0400 | ||
@@ -614,7 +614,8 @@ static int save_external_coredump( | ||
if (lseek(fd, 0, SEEK_SET) == (off_t) -1) | ||
return log_error_errno(errno, "Failed to seek on coredump %s: %m", fn); | ||
|
||
- fn_compressed = strjoin(fn, COMPRESSED_EXT); | ||
+ /* For Mariner 2, we are HARDCODING coredump compression to use LZ4 because Azure Watson can't handle ZSTD */ | ||
+ fn_compressed = strjoin(fn, ".lz4"); | ||
if (!fn_compressed) | ||
return log_oom(); | ||
|
||
@@ -622,7 +623,8 @@ static int save_external_coredump( | ||
if (fd_compressed < 0) | ||
return log_error_errno(fd_compressed, "Failed to create temporary file for coredump %s: %m", fn_compressed); | ||
|
||
- r = compress_stream(fd, fd_compressed, max_size, &uncompressed_size); | ||
+ /* For Mariner 2, we are HARDCODING coredump compression to use LZ4 because Azure Watson can't handle ZSTD */ | ||
+ r = compress_stream_lz4(fd, fd_compressed, max_size, &uncompressed_size); | ||
if (r < 0) | ||
return log_error_errno(r, "Failed to compress %s: %m", coredump_tmpfile_name(tmp_compressed)); | ||
|
||
@@ -635,7 +637,8 @@ static int save_external_coredump( | ||
tmp = unlink_and_free(tmp); | ||
fd = safe_close(fd); | ||
|
||
- r = compress_stream(input_fd, fd_compressed, max_size, &partial_uncompressed_size); | ||
+ /* For Mariner 2, we are HARDCODING coredump compression to use LZ4 because Azure Watson can't handle ZSTD */ | ||
+ r = compress_stream_lz4(input_fd, fd_compressed, max_size, &partial_uncompressed_size); | ||
if (r < 0) | ||
return log_error_errno(r, "Failed to compress %s: %m", coredump_tmpfile_name(tmp_compressed)); | ||
uncompressed_size += partial_uncompressed_size; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters