]> git.baikalelectronics.ru Git - kernel.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)
commit91921663e981bbf84407f38eda4823dd195c48ea
tree3055bcddc3d5f92506ac6a56ada73227e431fbb9
parentd9d352bfef7d75fba0e04e3f4f01166458bbe1b7
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 e4777e3200c92 ("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: e4777e3200c92 ("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