Skip to content

Commit a841c67

Browse files
akpm00torvalds
authored andcommitted
revert "initramfs: cleanup incomplete rootfs"
Revert ff1522b ("initramfs: cleanup incomplete rootfs"). Andy reports : This breaks my setup where I have U-boot provided more size of initramfs : than needed. This allows a bit of flexibility to increase or decrease : initramfs compressed image without taking care of bootloader. The proper : solution is to do this if we sure that we didn't get enough memory, : otherwise I can't consider the error fatal to clean up rootfs. Fixes: ff1522b ("initramfs: cleanup incomplete rootfs") Reported-by: Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: David Engraf <david.engraf@sysgo.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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 2137397 commit a841c67

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

init/initramfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ static void __init free_initrd(void)
550550
initrd_end = 0;
551551
}
552552

553+
#ifdef CONFIG_BLK_DEV_RAM
553554
#define BUF_SIZE 1024
554555
static void __init clean_rootfs(void)
555556
{
@@ -596,6 +597,7 @@ static void __init clean_rootfs(void)
596597
ksys_close(fd);
597598
kfree(buf);
598599
}
600+
#endif
599601

600602
static int __init populate_rootfs(void)
601603
{
@@ -638,10 +640,8 @@ static int __init populate_rootfs(void)
638640
printk(KERN_INFO "Unpacking initramfs...\n");
639641
err = unpack_to_rootfs((char *)initrd_start,
640642
initrd_end - initrd_start);
641-
if (err) {
643+
if (err)
642644
printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
643-
clean_rootfs();
644-
}
645645
free_initrd();
646646
#endif
647647
}

0 commit comments

Comments
 (0)