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".
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-05-31 19:29:07 +02:00
parent a88f9dbae2
commit 23b8aa648d
2 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -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",
+8 -8
View File
@@ -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;