Commit e5eed351 authored by David Engraf's avatar David Engraf Committed by Linus Torvalds

init/initramfs.c: provide more details in error messages

Use distinct error messages when archive decompression failed.

Link: http://lkml.kernel.org/r/20190212075635.7373-1-david.engraf@sysgo.comSigned-off-by: default avatarDavid Engraf <david.engraf@sysgo.com>
Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Tested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1a6a1dbe
...@@ -431,7 +431,7 @@ static long __init flush_buffer(void *bufv, unsigned long len) ...@@ -431,7 +431,7 @@ static long __init flush_buffer(void *bufv, unsigned long len)
len -= written; len -= written;
state = Reset; state = Reset;
} else } else
error("junk in compressed archive"); error("junk within compressed archive");
} }
return origLen; return origLen;
} }
...@@ -488,9 +488,9 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len) ...@@ -488,9 +488,9 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len)
message = msg_buf; message = msg_buf;
} }
} else } else
error("junk in compressed archive"); error("invalid magic at start of compressed archive");
if (state != Reset) if (state != Reset)
error("junk in compressed archive"); error("junk at the end of compressed archive");
this_header = saved_offset + my_inptr; this_header = saved_offset + my_inptr;
buf += my_inptr; buf += my_inptr;
len -= my_inptr; len -= my_inptr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment