Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1065929pxb; Sun, 19 Sep 2021 05:11:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLaDgdcpTEjE9oQZ1A4rXYdOM+xdy1eHzMOcOtU0+qhVe9Sdt+3q2uaLvQqMAaFN9hLWWp X-Received: by 2002:a05:6402:1e90:: with SMTP id f16mr23144795edf.136.1632053462634; Sun, 19 Sep 2021 05:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632053462; cv=none; d=google.com; s=arc-20160816; b=aPb2cVXKS8rDaqwLP5XzTHstqXZSmEJGAtG+ye3k7eumOn4e7smvXBEc0Gs+l3TJ7f lp03wy4OeNV3ei6B0asqS3Nrwv22OicUXsfIpxClLaVG/oAjdC6QkyPvLtCI8iIYkWbD KIjNfh1hpuDYqtwCmLRyiViRG/bWXK1/3peFjDE+X1oJAnj+HbrzUCwCBOGCZGhs8OBH Wpw4AeT6Qq5C8TndUpCjGRBitrhFvJXH/hv8omHfjh/HIq8LIGUBRMHMUwF2iFhjqSSp ZJaHwAEIQ/sreIBbq9uoENEbSPzVr83KFbg8DUpNkWnAh6sNgFU9QYh6a+0a6RS57OiN 3oIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=cHbUD6UhRIl/lYxCfSauPrsPOhOVn6GigEKXrKaUEpE=; b=jgZOmXNlvGxYG9bLgYVQLYEe7kTPx7Gh88DMSm3ii0s4H3o8h7sgGmxWuwIYkQUaj2 3rqZ6+beC/YpuS2NkMnZZoxF2xif9Iovjtv8fZjBOyUFjyE/p+EFxs8OBTR4xW9ciXiP XIqVWKp6BtweG54Pa6ESbc+drXZ5QwJXVFIgos4OEWq7XUZuKu+NWBGz1bU4TdbBwQlF qoJIlNzkgL+Z9njzUmfS80+npK18wU8zap314JYGe4hgR02PUPJVqkCuZ9HC7Hs8k7X1 zm0VHI1bttKmCdmwUMw49zSfd83PXGf8B5ug0ZjsLnWNDoBLw6nOcGXb5QtmdF8PVDfN M0hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si13798577edq.5.2021.09.19.05.10.37; Sun, 19 Sep 2021 05:11:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232463AbhISGKQ (ORCPT + 99 others); Sun, 19 Sep 2021 02:10:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230158AbhISGKP (ORCPT ); Sun, 19 Sep 2021 02:10:15 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D734FC061574 for ; Sat, 18 Sep 2021 23:08:50 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mRq0K-005Vgc-NS; Sun, 19 Sep 2021 06:08:45 +0000 Date: Sun, 19 Sep 2021 06:08:44 +0000 From: Al Viro To: Leon Romanovsky Cc: Christoph Hellwig , linux-kernel@vger.kernel.org, Jason Gunthorpe , Linus Torvalds Subject: Re: [PATCH -rc] init: don't panic if mount_nodev_root failed Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 19, 2021 at 08:46:39AM +0300, Leon Romanovsky wrote: > On Tue, Sep 14, 2021 at 12:12:10PM +0300, Leon Romanovsky wrote: > > From: Leon Romanovsky > > > > Attempt to mount 9p file system as root gives the following kernel panic: > > > > 9pnet_virtio: no channels available for device root > > Kernel panic - not syncing: VFS: Unable to mount root "root" (9p), err=-2 > > CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.15.0-rc1+ #127 > > Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 > > Call Trace: > > dump_stack_lvl+0x45/0x59 > > panic+0x1e2/0x44b > > ? __warn_printk+0xf3/0xf3 > > ? free_unref_page+0x2d4/0x4a0 > > ? trace_hardirqs_on+0x32/0x120 > > ? free_unref_page+0x2d4/0x4a0 > > mount_root+0x189/0x1e0 > > prepare_namespace+0x136/0x165 > > kernel_init_freeable+0x3b8/0x3cb > > ? rest_init+0x2e0/0x2e0 > > kernel_init+0x19/0x130 > > ret_from_fork+0x1f/0x30 > > Kernel Offset: disabled > > ---[ end Kernel panic - not syncing: VFS: Unable to mount root "root" (9p), err=-2 ]--- > > > > QEMU command line: > > "qemu-system-x86_64 -append root=/dev/root rw rootfstype=9p rootflags=trans=virtio ..." > > > > This error is because root_device_name is truncated in prepare_namespace() from > > being "/dev/root" to be "root" prior to call to mount_nodev_root(). > > > > As a solution, don't treat errors in mount_nodev_root() as errors that > > require panics and allow failback to the mount flow that existed before > > patch citied in Fixes tag. > > > > Fixes: f9259be6a9e7 ("init: allow mounting arbitrary non-blockdevice filesystems as root") > > Signed-off-by: Leon Romanovsky > > --- > > I'm not sure if this is the right thing to do, but it works for me. > > --- > > init/do_mounts.c | 3 --- > > 1 file changed, 3 deletions(-) > > Hi, > > I assume that after Christoph gave his ROB [1], the patch is ok. > Should I do anything else in order to progress with merging it? Sits in the local pile; will go to Linus tomorrow...