diff options
author | Hayden Walles <hgwalles@gmail.com> | 2015-12-23 13:59:31 -0500 |
---|---|---|
committer | Hayden Walles <hgwalles@gmail.com> | 2016-01-25 12:21:11 -0500 |
commit | 5f3e0a74689f2acf05c37f5203acec0b8d067458 (patch) | |
tree | 6c8646800fedd459208e5f396064c480015798cd /src/resolve/resolved-dns-server.c | |
parent | 654d1b335030acccf0894a58b7a30e3130b05383 (diff) |
coredump: fix bug that loses core dump files when core dumps are compressed and disk space is low.
Previously the save_external_coredump function returned a file
descriptor corresponding to the dumped file. This descriptor was used
for two different purposes by calling code: a) access to the raw core
dump data; b) testing candidate files (via inode comparisons) while
vacuuming to protect the current core dump from vacuuming.
The descriptor returned always corresponded to a file containing the raw
core dump data. However if compresson was used and the core dump was
compressed then the descriptor returned did not correspond to the file
that would eventually be left on disk (ie the compressed file). Thus
the file was never protected by vacuuming. When disk space was low all
core dumps including the current one would be vacuumed and the
corresponding log message referred to a file that no longer existed.
This resulted in the following error message from coredumpctl if the
missing core dump was requested:
Cannot retrieve coredump from journal nor disk.
Failed to retrieve core: No such file or directory
save_external_coredump now returns two descriptors, one to be used for
inode comparisons to prevent overzealous vacuuming and one to be used
for raw data access. When compression is not used the returned inode
comparison descriptor will be invalid, indicating that the raw data
access descriptor should be used for inode comparisons as well.
Corresponding use of save_external_coredump and the returned
descriptors also updated.
Diffstat (limited to 'src/resolve/resolved-dns-server.c')
0 files changed, 0 insertions, 0 deletions