From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752345AbdEDHsI (ORCPT ); Thu, 4 May 2017 03:48:08 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:58426 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751809AbdEDHr7 (ORCPT ); Thu, 4 May 2017 03:47:59 -0400 Subject: Re: [BUG] OpenRISC exec init fails, bisected to 0886551 ("initramfs: finish fput() before accessing any binary from initramfs") To: Stafford Horne , LKML References: <20170504071118.GA17317@lianli.shorne-pla.net> CC: Murali Karicheri , Al Viro From: Lokesh Vutla Message-ID: <9860c33a-c940-6a63-3736-64f864b6d602@ti.com> Date: Thu, 4 May 2017 13:15:23 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170504071118.GA17317@lianli.shorne-pla.net> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thursday 04 May 2017 12:41 PM, Stafford Horne wrote: > Hello, > > While booting the v4.11 kernel I found the below issue. > > The summary of the issue mentions > > Commit 4a9d4b024a31 ("switch fput to task_work_add") implements a > schedule_work() for completing fput(), but did not guarantee calling > __fput() after unpacking initramfs. Because of this, there is a > possibility that during boot a driver can see ETXTBSY when it tries to > load a binary from initramfs as fput() is still pending on that binary. > > It seems this patch (0886551) introduces that issue though? > > I am looking into it, but any suggestions would be helpful. Can you check if flush_delayed_fput() is being called? Do you have CONFIG_INITRAMFS_FORCE enabled? Can I see complete boot log? Thanks and regards, Lokesh > > BOOT LOG > > Compiled-in FDT at c03b9100 > Linux version 4.10.0-10351-g0886551 (shorne@lianli.shorne-pla.net) (gcc version 5.4.0 (GCC) ) #223 Thu May 4 16:01:02 JST 2017 > CPU: OpenRISC-0 (revision 0) @20 MHz > ... > Freeing unused kernel memory: 2856K > This architecture does not have kernel memory protection. > Failed to execute /init (error -26) > Starting init: /sbin/init exists but couldn't execute it (error -26) > Starting init: /bin/sh exists but couldn't execute it (error -26) > Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. > ---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance. > > > TO REPRODUCE > > The failure is intermittent. > > Using some tools: > - initramfs: https://github.com/stffrdhrn/or1k-utils > - compiler: https://github.com/openrisc/or1k-gcc/releases (or1k-linux-5.4.0-20170218.tar.xz) > - qemu: version 2.9 > > Make and run using: > make ARCH=openrisc defconfig > make -j5 ARCH=openrisc CROSS_COMPILE=or1k-linux- \ > CONFIG_INITRAMFS_SOURCE="../openrisc/or1k-utils/initramfs ../openrisc/or1k-utils/initramfs.devnodes" > > qemu-system-or1k -cpu or1200 -M or1k-sim -kernel vmlinux -serial stdio \ > -nographic -monitor none > > -Stafford >