diff --git a/kernel/lib_log.c b/kernel/lib_log.c index 29633783..1c011a7d 100644 --- a/kernel/lib_log.c +++ b/kernel/lib_log.c @@ -869,23 +869,10 @@ int log_scan(void *buf, DATA_GET(buf, offset, start_magic); if (unlikely(start_magic != START_MAGIC)) { - /* Skip any zeros without notice. - * This may be used for future extensions, like - * padding at certain places of logfiles. - */ - if (start_magic != 0) { - dirty = true; - classify_bad_magic(start_magic, - &start_byte_code, - mars_error_code); - if (start_byte_code && !*byte_code) { - *byte_code = start_byte_code; - MARS_WRN(SCAN_TXT "found repeated byte pattern 0x%02x", - SCAN_PAR, - start_byte_code); - } - } - continue; + MARS_ERR(SCAN_TXT "bad start magic 0x%llx\n", + SCAN_PAR, start_magic); + RECORD_ERR(-MARS_ERR_SCAN_MAGIC); + return -EBADMSG; } restlen = len - i; diff --git a/kernel/mars_errno.h b/kernel/mars_errno.h index c8c24003..d0f79ca1 100644 --- a/kernel/mars_errno.h +++ b/kernel/mars_errno.h @@ -55,6 +55,7 @@ #define MARS_ERR_SCAN_SEQ_FW 10010 /* Illegal record sequence skip forward */ #define MARS_ERR_SCAN_SEQ_BW 10011 /* Record sequence skip backwards */ #define MARS_ERR_SCAN_SIZE 10012 /* Internal size mismatch */ +#define MARS_ERR_SCAN_MAGIC 10013 /* Unrecognized record */ #define MARS_ERR_MAGIC_BAD 10020 /* Bad magic */ #define MARS_ERR_MAGIC_REPEATED 10021 /* Bad magic has repeated pattern */