Message ID | 20230607135746.92995-1-hch@lst.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp224546vqr; Wed, 7 Jun 2023 07:06:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4diTeHocuCrGmcITDaxEeSCB6s9q2+EgE4XhQtJF4oLu3tvGvxiSgcFbT+uCFRSZTdvf2I X-Received: by 2002:a05:6a00:21d6:b0:644:d775:60bb with SMTP id t22-20020a056a0021d600b00644d77560bbmr2241770pfj.20.1686146791391; Wed, 07 Jun 2023 07:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686146791; cv=none; d=google.com; s=arc-20160816; b=qw+Ng/o8O4TxX0DJabeOI+nwz11vwwQbAHxk3jL8fpfpkU5lw4GoAWRqZx5n2W1GDo kzSrcYeYJ1UhlhESNDiG2+FbseMxkI16YxujBx9mJ34YylEhZAnJtRvdKLnVt9Ha057z UMygeKyoU5LdDg1sX0GBK2s23JPUznPXTpJXyzIXK0IE+kjEPiwbwy0ZEiO8zsUrT2qW CAXcsN74mNkzLBekBTW4ZcwwRAMEZd7JsrPMfSaWYWoR2awZmwJD6o4QQMuh6XMIRWkG c4KduLSz0ARVWQUIaDUyIq76m3KSXr21IKvb15VJNfbUkknacTQDin3Th0ERxC9n5x7N jGiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=NSaEYLWq1uop5RvYK0pIoKPvJvXi1yt9B2Xcy8b2PnQ=; b=tuwsJ59UCvtQsVlcoK7XQl8WdysNfvkkksIW7/Qtl3D9HbtIGTXir28s0lmluXZjpS De8erw44EfBl8qek0SKJkbwGCyaHBYiubO09aSFDuxxY8DVvIgF7vkKbKe+u8T0vBlWi RbxuF83CAB2Dz0vu5lmeUK89X2D2+xg3PbvOr561PcCJFSNKfCTTglY72q4vwcyCYiHY +4EZymDRqTvZH8CQXhhFUc8ozdykXm/G1VgXFvbBQY2dIJQrX4CXukZgFpDVmUSpFZ7T Le+Jp2K6vJ0rPj5/pgNsvE9olt7Z7Ay3wnZyLmFZmJczhPL8yNIHsGHmqgjfNv8xYdbN yiPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=bfc0guQd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f7-20020a637547000000b00543cbc5da0bsi3783135pgn.211.2023.06.07.07.06.15; Wed, 07 Jun 2023 07:06:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=bfc0guQd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240021AbjFGN5v (ORCPT <rfc822;xxoosimple@gmail.com> + 99 others); Wed, 7 Jun 2023 09:57:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239372AbjFGN5u (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 7 Jun 2023 09:57:50 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A71BB1BD9 for <linux-kernel@vger.kernel.org>; Wed, 7 Jun 2023 06:57:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=NSaEYLWq1uop5RvYK0pIoKPvJvXi1yt9B2Xcy8b2PnQ=; b=bfc0guQdVCpaub5btItUyB3uI3 xgelyRxUKOw2TeFVvNZOkgsJNND59ze3QI73FCFr51UFR2xXiUSIxKWtpzJMenyATgfwQsNNhKqH5 E3YqYVoJIICB19Zye9X1RVzfQCoURGwUXwMJl3S+N8dYg3mlBBgys1/RRKD+yWMve1WijtSQ4f+MU ta7nlxDBA3XH/FvU+nqQlGe5YgwOTU7sTjBUEHmy/KT+dgwkmEfSi4CVcQ7/xE1tfayC0ZPznhqlt kAP3TBnf1Mpbj9rx7EzoLe7oMuMqi1FfYhygPYa5JhGppMgcgvBl2raqdnJ2O0YuxePcRBwbd2AJK ztBUhePQ==; Received: from 2a02-8389-2341-5b80-8c8c-28f8-1274-e038.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:8c8c:28f8:1274:e038] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1q6tfY-006AW8-0c; Wed, 07 Jun 2023 13:57:48 +0000 From: Christoph Hellwig <hch@lst.de> To: axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, Fabio Estevam <festevam@gmail.com> Subject: [PATCH] block: fix rootwait= Date: Wed, 7 Jun 2023 15:57:46 +0200 Message-Id: <20230607135746.92995-1-hch@lst.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768053057564332063?= X-GMAIL-MSGID: =?utf-8?q?1768053057564332063?= |
Series |
block: fix rootwait=
|
|
Commit Message
Christoph Hellwig
June 7, 2023, 1:57 p.m. UTC
Failures to look up the gendisk must return -ENODEV so that rootwait retries the lookup instead of -EINVAL which exits early. Fixes: cf056a431215 ("init: improve the name_to_dev_t interface") Reported-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Fabio Estevam <festevam@gmail.com> --- [Jens, if you need to rebase for any reason it might make sense to fold this into the offending patch] block/early-lookup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On 6/7/23 7:57 AM, Christoph Hellwig wrote: > Failures to look up the gendisk must return -ENODEV so that rootwait > retries the lookup instead of -EINVAL which exits early. > > Fixes: cf056a431215 ("init: improve the name_to_dev_t interface") > Reported-by: Fabio Estevam <festevam@gmail.com> > Signed-off-by: Christoph Hellwig <hch@lst.de> > Tested-by: Fabio Estevam <festevam@gmail.com> > --- > > [Jens, if you need to rebase for any reason it might make sense to fold > this into the offending patch] I have applied it for now, and probably not a high likelihood of rebasing this late. But if I do, I'll fold it in.
On Wed, Jun 07, 2023 at 03:57:46PM +0200, Christoph Hellwig wrote: > Failures to look up the gendisk must return -ENODEV so that rootwait > retries the lookup instead of -EINVAL which exits early. This appears to be causing failures to find a root filesystem located on a partition on a virtio device virtio-blk when booting on Arm FVP virtual platforms on today's -next. With root=/dev/vda1 we find the device: [ 0.593310] virtio_blk virtio0: 1/0/0 default/read/poll queues [ 0.594413] virtio_blk virtio0: [vda] 2929688 512-byte logical blocks (1.50 GB/1.40 GiB) [ 0.598898] vda: vda1 but then when it comes time to mount the rootfs we get: [ 1.035643] Waiting for root device /dev/vda1... instead of mounting the device we already knew about. A bisect (log below) lands on this commit and reverting the first hunk: > @@ -181,7 +181,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt) > *p = '\0'; > *devt = blk_lookup_devt(s, part); > if (*devt) > - return 0; > + return -ENODEV; avoids the issue and allows us to boot as normal. I need to stare at the code a bit more to fully follow the intent of that bit of the change but I'm about done for today, the commit log just mentions replacing -EINVAL rather than 0. Bisect log: git bisect start # bad: [db10f126048021b86e43a5d6a335ec49dec10155] Add linux-next specific files for 20230608 git bisect bad db10f126048021b86e43a5d6a335ec49dec10155 # good: [5f63595ebd82f56a2dd36ca013dd7f5ff2e2416a] Merge tag 'input-for-v6.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input git bisect good 5f63595ebd82f56a2dd36ca013dd7f5ff2e2416a # good: [dc3648f0663a83e9399f44faa473ce8891f8a469] Merge branch 'drm-next' of git://git.freedesktop.org/git/drm/drm.git git bisect good dc3648f0663a83e9399f44faa473ce8891f8a469 # bad: [80f5925ba46062fd05697d83717d67162ae18812] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git git bisect bad 80f5925ba46062fd05697d83717d67162ae18812 # good: [2c5161ad2db3e89b608b89e4994e23ab58db7162] Merge branch 'for-linux-next' of git://anongit.freedesktop.org/drm-intel git bisect good 2c5161ad2db3e89b608b89e4994e23ab58db7162 # good: [0e425a6896902e0112a4da8cbf71c067ec6d6d8f] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git git bisect good 0e425a6896902e0112a4da8cbf71c067ec6d6d8f # good: [2dc4eeb36feb4b5baae9ec9ef145c974007d94b8] Merge branch 'for-6.5/block' into for-next git bisect good 2dc4eeb36feb4b5baae9ec9ef145c974007d94b8 # bad: [e0e9727312109e289bcce88bbd2bbe86b9a209ca] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata.git git bisect bad e0e9727312109e289bcce88bbd2bbe86b9a209ca # good: [182faecd1a321d626190cb7e87d814da04c2a083] Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git git bisect good 182faecd1a321d626190cb7e87d814da04c2a083 # bad: [f3e6f4e23cc82971bda01ef5cacb716fb564c7aa] Merge branch 'for-6.5/io_uring' into for-next git bisect bad f3e6f4e23cc82971bda01ef5cacb716fb564c7aa # bad: [80d994d2a71f88e0809dcaccef2259c791d2e3ef] pktcdvd: Use DEFINE_SHOW_ATTRIBUTE() to simplify code git bisect bad 80d994d2a71f88e0809dcaccef2259c791d2e3ef # bad: [3a41db531e5124adaa3a9ab9ca0c724aee85b10c] pktcdvd: Get rid of custom printing macros git bisect bad 3a41db531e5124adaa3a9ab9ca0c724aee85b10c # good: [a7cfa0af0c88353b4eb59db5a2a0fbe35329b3f9] blk-ioc: fix recursive spin_lock/unlock_irq() in ioc_clear_queue() git bisect good a7cfa0af0c88353b4eb59db5a2a0fbe35329b3f9 # bad: [1341c7d2ccf42ed91aea80b8579d35bc1ea381e2] block: fix rootwait= git bisect bad 1341c7d2ccf42ed91aea80b8579d35bc1ea381e2 # good: [3d2af77e31ade05ff7ccc3658c3635ec1bea0979] blk-cgroup: Reinit blkg_iostat_set after clearing in blkcg_reset_stats() git bisect good 3d2af77e31ade05ff7ccc3658c3635ec1bea0979 # first bad commit: [1341c7d2ccf42ed91aea80b8579d35bc1ea381e2] block: fix rootwait=
Hi Mark, On Thu, Jun 8, 2023 at 3:26 PM Mark Brown <broonie@kernel.org> wrote: > instead of mounting the device we already knew about. A bisect (log > below) lands on this commit and reverting the first hunk: > > > @@ -181,7 +181,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt) > > *p = '\0'; > > *devt = blk_lookup_devt(s, part); > > if (*devt) > > - return 0; > > + return -ENODEV; I have tested reverting this first hunk and it also works for me, so if someone submits this fix: Tested-by: Fabio Estevam <festevam@gmail.com> Thanks
On Thu, Jun 08, 2023 at 10:02:00PM -0300, Fabio Estevam wrote: > > below) lands on this commit and reverting the first hunk: > > > > > @@ -181,7 +181,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt) > > > *p = '\0'; > > > *devt = blk_lookup_devt(s, part); > > > if (*devt) > > > - return 0; > > > + return -ENODEV; > > I have tested reverting this first hunk and it also works for me, so > if someone submits this fix: Yes, the first hunk is completely bogus, sorry. I'll send the fix.
diff --git a/block/early-lookup.c b/block/early-lookup.c index 3ff0d2e4dcbfb8..48ea3e982419cc 100644 --- a/block/early-lookup.c +++ b/block/early-lookup.c @@ -181,7 +181,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt) *p = '\0'; *devt = blk_lookup_devt(s, part); if (*devt) - return 0; + return -ENODEV; /* try disk name without p<part number> */ if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p') @@ -190,7 +190,7 @@ static int __init devt_from_devname(const char *name, dev_t *devt) *devt = blk_lookup_devt(s, part); if (*devt) return 0; - return -EINVAL; + return -ENODEV; } static int __init devt_from_devnum(const char *name, dev_t *devt)