From: Zbigniew Jędrzejewski-Szmek Date: Mon, 31 May 2021 10:11:48 +0000 (+0200) Subject: journal-remote: downgrade messages about input data to warnings X-Git-Tag: v249-rc1~124^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23b8aa648d1d8cb1209ddd521989aa47f9344f68;p=thirdparty%2Fsystemd.git journal-remote: downgrade messages about input data to warnings Those are unexpected, so a user-visible message seems appropriate. But they are not our errors, and to some extent we can recover from them, so "warning" seems more appropriate than "error". --- diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c index 7bc349c3042..2ece329251f 100644 --- a/src/journal-remote/journal-remote-parse.c +++ b/src/journal-remote/journal-remote-parse.c @@ -74,7 +74,7 @@ int process_source(RemoteSource *source, bool compress, bool seal) { &source->importer.boot_id, compress, seal); if (r == -EBADMSG) { - log_error_errno(r, "Entry is invalid, ignoring."); + log_warning_errno(r, "Entry is invalid, ignoring."); r = 0; } else if (r < 0) log_error_errno(r, "Failed to write entry of %zu bytes: %m", diff --git a/src/shared/journal-importer.c b/src/shared/journal-importer.c index 0d82acc25cd..9e11dc09c1c 100644 --- a/src/shared/journal-importer.c +++ b/src/shared/journal-importer.c @@ -69,9 +69,9 @@ static int get_line(JournalImporter *imp, char **line, size_t *size) { imp->scanned = imp->filled; if (imp->scanned >= DATA_SIZE_MAX) - return log_error_errno(SYNTHETIC_ERRNO(ENOBUFS), - "Entry is bigger than %u bytes.", - DATA_SIZE_MAX); + return log_warning_errno(SYNTHETIC_ERRNO(ENOBUFS), + "Entry is bigger than %u bytes.", + DATA_SIZE_MAX); if (imp->passive_fd) /* we have to wait for some data to come to us */ @@ -163,9 +163,9 @@ static int get_data_size(JournalImporter *imp) { imp->data_size = unaligned_read_le64(data); if (imp->data_size > DATA_SIZE_MAX) - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "Stream declares field with size %zu > DATA_SIZE_MAX = %u", - imp->data_size, DATA_SIZE_MAX); + return log_warning_errno(SYNTHETIC_ERRNO(EINVAL), + "Stream declares field with size %zu > DATA_SIZE_MAX = %u", + imp->data_size, DATA_SIZE_MAX); if (imp->data_size == 0) log_warning("Binary field with zero length"); @@ -203,8 +203,8 @@ static int get_data_newline(JournalImporter *imp) { int l; l = cescape_char(*data, buf); - return log_error_errno(SYNTHETIC_ERRNO(EINVAL), - "Expected newline, got '%.*s'", l, buf); + return log_warning_errno(SYNTHETIC_ERRNO(EINVAL), + "Expected newline, got '%.*s'", l, buf); } return 1;