]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
initramfs: Always do fput() and load modules after rootfs populate
authorStafford Horne <shorne@gmail.com>
Thu, 4 May 2017 12:15:56 +0000 (21:15 +0900)
committerStafford Horne <shorne@gmail.com>
Fri, 5 May 2017 07:01:08 +0000 (16:01 +0900)
commit17a9be31747535184f2af156b1f080ec4c92a952
tree3055bcddc3d5f92506ac6a56ada73227e431fbb9
parenta351e9b9fc24e982ec2f0e76379a49826036da12
initramfs: Always do fput() and load modules after rootfs populate

In OpenRISC we do not have a bootloader passed initrd, but the built in
initramfs does contain the /init and other binaries, including modules.
The previous commit 08865514805d2 ("initramfs: finish fput() before
accessing any binary from initramfs") made a change to only call fput()
if the bootloader initrd was available, this caused intermittent crashes
for OpenRISC.

This patch changes the fput() to happen unconditionally if any rootfs is
loaded. Also, I added some comments to make it a bit more clear why we
call unpack_to_rootfs() multiple times.

Fixes: 08865514805d2 ("initramfs: finish fput() before accessing any binary from initramfs")
Cc: stable@vger.kernel.org
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Stafford Horne <shorne@gmail.com>
init/initramfs.c