Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3968840rwd; Tue, 23 May 2023 00:48:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5pLrwzoVz5EsOJ0zeFrltKCY2xKgLycZI01h+X+8EM1yBSxuTP4a+gJqMvgdSTZ4N7ciPZ X-Received: by 2002:a17:903:492:b0:1ab:1624:38cf with SMTP id jj18-20020a170903049200b001ab162438cfmr12417740plb.60.1684828099476; Tue, 23 May 2023 00:48:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684828099; cv=none; d=google.com; s=arc-20160816; b=QliX86XmC9nBt576SoOW6Edui9irxttejsJmCuFO4tg+22C1zUFCMTcnVyN6F9iHia oHHoGCOHW83w/3DSyIyYHRBKgXkvGtcBOBbLIuKA93frthr5pc6IC4syk3q7+uCE/PGT 8C+pDdNcsgTN0nS7UOXudgyNTicDkCry93FsrFh/retLOmfK8ThXBKdPCWCrlEYNXGjN n7V6saKBOS6CavpvhziUXOFhqsja1mSeIt7ZgiiJx9xueLaqggxf0RA/uKPTxSAsEbNL 6rnFWhtUNdcufHV59+YFhnBq65usiAMei01HJG2fj8MIlCBsG9IKldftNAGGhHsvLvV+ BHJg== 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=b4caBsqRj9WgFDF1CdiyuIzyBrf32buPv15Igm1OGNU=; b=HAGNybaeFrXn8zWaEDBQ3+IHMZEFU5VVYojczEO2dT1QrqCF4y/2QxFoPCaVNIOzLQ s4hKSHCeGVVkf6ExdjBJqhXoZgbbnZ4Up7XzQb8O7VrQhzW02kgcERaj61SN67al0GA+ wA0Vx9rooOm9CBTTPU5iPUONcZ2wVR5K1aGuH8nosAqRUIcIgoVCQuJVuX8d2YxeOiJ/ dZc3TyDTwfJqHbZCiydxG1Hqw2qx3peSGBgpufk8uYAVLPXtMMcyqEaRamKAAWaXjK02 VLI9xeKh6RtzKNb3+z68XyJzAiaz3Iq2ep/sVN0IUxA3kDH4kMwoO3saDySj0pOnkxqu SlMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=WhENlxHU; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v3-20020a170902d68300b001a63d07af3csi5704225ply.41.2023.05.23.00.48.04; Tue, 23 May 2023 00:48:19 -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=WhENlxHU; 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 S235684AbjEWHq3 (ORCPT + 99 others); Tue, 23 May 2023 03:46:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235184AbjEWHqD (ORCPT ); Tue, 23 May 2023 03:46:03 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78870C5; Tue, 23 May 2023 00:45:59 -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=b4caBsqRj9WgFDF1CdiyuIzyBrf32buPv15Igm1OGNU=; b=WhENlxHUIDOj4WfSHpZmeGSqbG vUiinRR9sgFVzAa6AJUpClm6jiechzZRFCFoQOMBZgcgEyyNfTPkP91bAtG69iCrNEq/glQ/uJbNx sAOQ62dPF9soTqb0kTrLOwvxuMSQt5oW6OzozXVmnZvgp/wauMKJRxyVsHuNGgJsCVYGzh7D01TWu caWLwi0NXlp+j+GN8bktnbZRg2OcJyv/uKT1OuzU3MMn/gNrZttHEkMPnvMkbUA53UNwWPOcTb/hS /FeK4JBZmKQY0mPDmXMOVZpL0vVDpadh2lV6EKfqVBTZSgXK5QlkE/1IVOY53AaWwoNvZ6GHaMTIg oj91dTFQ==; Received: from [2001:4bb8:188:23b2:6ade:85c9:530f:6eb0] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1q1Mi9-009GTZ-27; Tue, 23 May 2023 07:45:38 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Mike Snitzer , Joern Engel , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Pavel Machek , dm-devel@redhat.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-mtd@lists.infradead.org, linux-pm@vger.kernel.org Subject: fix the name_to_dev_t mess Date: Tue, 23 May 2023 09:45:11 +0200 Message-Id: <20230523074535.249802-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 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, this series tries to sort out accumulated mess around the name_to_dev_t function. This function is intended to allow looking up the dev_t of a block device based on a name string before the root file systems is mounted and thus the normal path based lookup is available. Unfortunately a few years ago it managed to get exported and used in non-init contexts, leading to the something looking like a path name also beeing lookuped up by a different and potential dangerous algorithm. This series does a fair amount of refactoring and finally ends up with the renamed and improved name_to_dev_t only beeing available for the early init code again. The series is against Jens' for-6.5/block tree but probably applies against current mainline just fine as well. A git tree is also available here: git://git.infradead.org/users/hch/block.git blk-init-cleanup Gitweb: http://git.infradead.org/users/hch/block.git/shortlog/refs/heads/blk-init-cleanup Diffstat: Documentation/admin-guide/kernel-parameters.txt | 2 arch/alpha/kernel/setup.c | 2 arch/ia64/kernel/setup.c | 2 arch/powerpc/platforms/powermac/setup.c | 3 block/Makefile | 2 block/early-lookup.c | 315 ++++++++++++++++++ block/genhd.c | 92 ----- drivers/base/dd.c | 6 drivers/md/dm-init.c | 4 drivers/md/dm-snap.c | 14 drivers/md/dm-table.c | 26 - drivers/md/md-autodetect.c | 3 drivers/mtd/devices/block2mtd.c | 62 ++- fs/pstore/blk.c | 4 include/linux/blkdev.h | 6 include/linux/device-mapper.h | 2 include/linux/device/driver.h | 2 include/linux/mount.h | 1 include/linux/root_dev.h | 9 init/do_mounts.c | 416 ++++++------------------ init/do_mounts.h | 14 init/do_mounts_initrd.c | 11 kernel/power/hibernate.c | 167 +++++---- kernel/power/power.h | 3 kernel/power/swap.c | 2 25 files changed, 603 insertions(+), 567 deletions(-)