aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-05-05 13:30:11 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-05 13:30:11 -0700
commit58017a3e284059186fa0dc16730e9f2ef336da61 (patch)
tree8558d4d3c0cbf6e1dbdc985d7921802b984b5716 /init
parentab182e67ec99ea0c8d7435a32a4a1ed9bb02559a (diff)
parent17a9be31747535184f2af156b1f080ec4c92a952 (diff)
downloadleg-kernel-58017a3e284059186fa0dc16730e9f2ef336da61.tar.gz
Merge tag 'initramfs-fix-4.12-rc1' of git://github.com/stffrdhrn/linux
Pull initramfs fix from Stafford Horne: "This is a fix for an issue that has caused 4.11 to not boot on OpenRISC. I should have caught this during the 4.11 cycle but I had been busy on testing some other series of patches. I would have considered pushing it though a different path but Al Viro suggested submitting directly to you. Also, its just one as I havent really got anything else ready on my queue for 4.12. Summary: - Ensure fput() flush is done even for builtin initramfs" * tag 'initramfs-fix-4.12-rc1' of git://github.com/stffrdhrn/linux: initramfs: Always do fput() and load modules after rootfs populate
Diffstat (limited to 'init')
-rw-r--r--init/initramfs.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/init/initramfs.c b/init/initramfs.c
index 981f286c1d16..3a6871597351 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -608,9 +608,11 @@ static void __init clean_rootfs(void)
static int __init populate_rootfs(void)
{
+ /* Load the built in initramfs */
char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
if (err)
panic("%s", err); /* Failed to decompress INTERNAL initramfs */
+ /* If available load the bootloader supplied initrd */
if (initrd_start) {
#ifdef CONFIG_BLK_DEV_RAM
int fd;
@@ -648,13 +650,14 @@ static int __init populate_rootfs(void)
printk(KERN_EMERG "Initramfs unpacking failed: %s\n", err);
free_initrd();
#endif
- flush_delayed_fput();
- /*
- * Try loading default modules from initramfs. This gives
- * us a chance to load before device_initcalls.
- */
- load_default_modules();
}
+ flush_delayed_fput();
+ /*
+ * Try loading default modules from initramfs. This gives
+ * us a chance to load before device_initcalls.
+ */
+ load_default_modules();
+
return 0;
}
rootfs_initcall(populate_rootfs);