initramfs: remove duplicate built-in __initramfs_start unpacking
authorDavid Disseldorp <ddiss@suse.de>
Thu, 11 Jan 2024 06:22:40 +0000 (17:22 +1100)
committerChristian Brauner <brauner@kernel.org>
Mon, 22 Jan 2024 14:33:36 +0000 (15:33 +0100)
If initrd_start cpio extraction fails, CONFIG_BLK_DEV_RAM triggers
fallback to initrd.image handling via populate_initrd_image().
The populate_initrd_image() call follows successful extraction of any
built-in cpio archive at __initramfs_start, but currently performs
built-in archive extraction a second time.

Prior to commit b2a74d5f9d446 ("initramfs: remove clean_rootfs"),
the second built-in initramfs unpack call was used to repopulate entries
removed by clean_rootfs(), but it's no longer necessary now the contents
of the previous extraction are retained.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Link: https://lore.kernel.org/r/20240111062240.9362-1-ddiss@suse.de
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>
init/initramfs.c

index 76deb48c38cb16dd779de7ee91b35785b6890579..d3c623dde01a887229b21d01abc58e68fa8b82d0 100644 (file)
@@ -679,8 +679,6 @@ static void __init populate_initrd_image(char *err)
        struct file *file;
        loff_t pos = 0;
 
-       unpack_to_rootfs(__initramfs_start, __initramfs_size);
-
        printk(KERN_INFO "rootfs image is not initramfs (%s); looks like an initrd\n",
                        err);
        file = filp_open("/initrd.image", O_WRONLY | O_CREAT, 0700);