From patchwork Tue May 23 07:45:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 685259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CAA1C7EE2D for ; Tue, 23 May 2023 07:46:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235610AbjEWHqT (ORCPT ); Tue, 23 May 2023 03:46:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235484AbjEWHqK (ORCPT ); Tue, 23 May 2023 03:46:10 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1C8BFE; Tue, 23 May 2023 00:46:08 -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:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=eh/PVrjGJIQ4a72HDzdbyMZabhpy1YXWsgmI3PXld44=; b=qsWptni8Px2QKG+K24lIUC3KFf jO4QMWHQU5cCmpzvN94lBN5jcbm3TUh7gTx1J67D5vFEkyMwedcV7iZT8DWSYsTX9kOlJRZiIo2i5 G79bt1DiC411aFTWXr+ZheY9HWtIcNLfrid1SBU4QgsT5Jp+XjLbiRJjEuHbp0AiZlOY76XzZDjVL BWUrBnlzdkN+L10M5wMe7KvUllmOvLdNjCym6HawVDr0+oR/c3LoWca61khLUp4DMnlJsjbxywBnO cCldTwBF47eS+ke7QiW1FVT5HKSUJGpJR0TG7fjTwpBIk2VH+D36+82mXU9ZvoH02/OnWdR9Fggzx JTSceNow==; 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 1q1MiY-009Ghn-18; Tue, 23 May 2023 07:46:02 +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: [PATCH 09/24] init: don't remove the /dev/ prefix from error messages Date: Tue, 23 May 2023 09:45:20 +0200 Message-Id: <20230523074535.249802-10-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230523074535.249802-1-hch@lst.de> References: <20230523074535.249802-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Remove the code that drops the /dev/ prefix from root_device_name, which is only used for error messages when mounting the root device fails. Signed-off-by: Christoph Hellwig --- init/do_mounts.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/init/do_mounts.c b/init/do_mounts.c index 1405ee7218bf00..74cc96bffbdd71 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -607,8 +607,6 @@ void __init mount_root(char *root_device_name) */ void __init prepare_namespace(void) { - char *root_device_name; - if (root_delay) { printk(KERN_INFO "Waiting %d sec before mounting root device...\n", root_delay); @@ -627,19 +625,16 @@ void __init prepare_namespace(void) md_run_setup(); if (saved_root_name[0]) { - root_device_name = saved_root_name; - if (!strncmp(root_device_name, "mtd", 3) || - !strncmp(root_device_name, "ubi", 3)) { - mount_root_generic(root_device_name, root_device_name, + if (!strncmp(saved_root_name, "mtd", 3) || + !strncmp(saved_root_name, "ubi", 3)) { + mount_root_generic(saved_root_name, saved_root_name, root_mountflags); goto out; } - ROOT_DEV = name_to_dev_t(root_device_name); - if (strncmp(root_device_name, "/dev/", 5) == 0) - root_device_name += 5; + ROOT_DEV = name_to_dev_t(saved_root_name); } - if (initrd_load(root_device_name)) + if (initrd_load(saved_root_name)) goto out; /* wait for any asynchronous scanning to complete */ @@ -652,7 +647,7 @@ void __init prepare_namespace(void) async_synchronize_full(); } - mount_root(root_device_name); + mount_root(saved_root_name); out: devtmpfs_mount(); init_mount(".", "/", NULL, MS_MOVE, NULL);