diff --git a/linux_5.10/fs/pstore/platform.c b/linux_5.10/fs/pstore/platform.c index 36714df37..e4c6e7f88 100644 --- a/linux_5.10/fs/pstore/platform.c +++ b/linux_5.10/fs/pstore/platform.c @@ -407,7 +407,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, oopscount++; while (total < kmsg_bytes) { - char *dst; + char *dst, *keyword; size_t dst_size; int header_size; int zipped_len = -1; @@ -439,6 +439,12 @@ static void pstore_dump(struct kmsg_dumper *dumper, dst_size, &dump_size)) break; + keyword = strnstr(dst + header_size, "Unable to handle kernel", dump_size); + if (keyword) { + dump_size -= (keyword - (dst + header_size)); + memmove(dst + header_size, keyword, dump_size); + } + if (big_oops_buf) { zipped_len = pstore_compress(dst, psinfo->buf, header_size + dump_size,