init/initramfs.c: provide more details in error messages
authorDavid Engraf <[email protected]>
Fri, 8 Mar 2019 00:30:19 +0000 (16:30 -0800)
committerLinus Torvalds <[email protected]>
Fri, 8 Mar 2019 02:32:02 +0000 (18:32 -0800)
Use distinct error messages when archive decompression failed.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: David Engraf <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Tested-by: Andy Shevchenko <[email protected]>
Cc: Dominik Brodowski <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Philippe Ombredanne <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Luc Van Oostenryck <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
init/initramfs.c

index fca899622937f48be0b47b25479fe3bff2252fcf..4749e1115eef3c8d079ab81c13a6a743314e1ef2 100644 (file)
@@ -431,7 +431,7 @@ static long __init flush_buffer(void *bufv, unsigned long len)
                        len -= written;
                        state = Reset;
                } else
-                       error("junk in compressed archive");
+                       error("junk within compressed archive");
        }
        return origLen;
 }
@@ -488,9 +488,9 @@ static char * __init unpack_to_rootfs(char *buf, unsigned long len)
                                message = msg_buf;
                        }
                } else
-                       error("junk in compressed archive");
+                       error("invalid magic at start of compressed archive");
                if (state != Reset)
-                       error("junk in compressed archive");
+                       error("junk at the end of compressed archive");
                this_header = saved_offset + my_inptr;
                buf += my_inptr;
                len -= my_inptr;