From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 14 Apr 2025 12:43:19 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u4HHb-000bdk-2N for lore@lore.pengutronix.de; Mon, 14 Apr 2025 12:43:19 +0200 Received: from bombadil.infradead.org ([2607:7c80:54:3::133]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u4HHb-0008GI-4o for lore@pengutronix.de; Mon, 14 Apr 2025 12:43:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AIbrA0xKIx7t60ZYWvb7TMWvynOGTYUQDsYbP1D+hWQ=; b=WBLAdD/Y2Zj82eVw8XO33POUKo F/kZAaESNs5F1dCSBTpEIfPH8okZoLfjT5VRz+aXqfGNP2j7/FACfYoVzFJoC+Kq/6s2drQcBNNX3 ab8myAzQfgSKcgi3jLoeuM08ijq9Lqd1nLlXAjUhSsIvtofiFpHo9HxuHAuVoI9gUUtbV2Z7+/xLw k8cO88+Xrrn2mZ3yppvtblQtJm7g6mvHJz+z4XdSMo7i0cdtfRXbpXXcx/nEAWK1W2/2UKqkwXlWo H7zm7r5O21mjz7cT6prHxP1xjQGEv7KrUSGOSJAXfdnx3sCGkM5RNdybGj4dCzqDHp25P4RCHpsKv oewlyLBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4HH3-00000001aeZ-2V9o; Mon, 14 Apr 2025 10:42:45 +0000 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1u4Gzo-00000001Vx9-3ncy for barebox@lists.infradead.org; Mon, 14 Apr 2025 10:24:58 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1u4Gzn-0001zg-54; Mon, 14 Apr 2025 12:24:55 +0200 Received: from pty.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::c5]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u4Gzm-000EYM-37; Mon, 14 Apr 2025 12:24:54 +0200 Received: from mfe by pty.whiteo.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1u4Gzm-000Fvs-2o; Mon, 14 Apr 2025 12:24:54 +0200 Date: Mon, 14 Apr 2025 12:24:54 +0200 From: Marco Felsch To: Ahmad Fatoum Cc: barebox@lists.infradead.org Message-ID: <20250414102454.awnbnv4ov2bgj33i@pengutronix.de> References: <20250414063152.2736649-1-a.fatoum@pengutronix.de> <20250414063152.2736649-12-a.fatoum@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250414063152.2736649-12-a.fatoum@pengutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250414_032457_023651_D46E044E X-CRM114-Status: GOOD ( 16.63 ) X-BeenThere: barebox@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "barebox" X-SA-Exim-Connect-IP: 2607:7c80:54:3::133 X-SA-Exim-Mail-From: barebox-bounces+lore=pengutronix.de@lists.infradead.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-5.2 required=4.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Subject: Re: [PATCH 11/18] misc: storage-by-uuid: consider only first diskuuid match X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on metis.whiteo.stw.pengutronix.de) On 25-04-14, Ahmad Fatoum wrote: > Multiple devices with the same disk UUID shouldn't happen and if it Do we need to print a warning to inform the user that two disks share the same disk-UUID? Regards, Marco > does, the existing code is not equipped to handle that. > > Change it, so only the first _disk_ is considered. diskuuid is in a > union with partuuid and that could lead to cdev partition being taken as > backend storage instead. > > Signed-off-by: Ahmad Fatoum > --- > drivers/misc/storage-by-uuid.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/misc/storage-by-uuid.c b/drivers/misc/storage-by-uuid.c > index 8b8fd901685e..7bb987dffbec 100644 > --- a/drivers/misc/storage-by-uuid.c > +++ b/drivers/misc/storage-by-uuid.c > @@ -143,10 +143,14 @@ static void check_exist(struct sbu *sbu) > struct cdev *cdev; > > for_each_cdev(cdev) { > - if (!strcmp(cdev->diskuuid, sbu->uuid)) { > - dev_dbg(sbu->dev, "Found %s %s\n", cdev->name, cdev->diskuuid); > - storage_by_uuid_add_partitions(sbu, cdev); > - } > + if (cdev_is_partition(cdev)) > + continue; > + if (strcmp(cdev->diskuuid, sbu->uuid)) > + continue; > + > + dev_dbg(sbu->dev, "Found %s %s\n", cdev->name, cdev->diskuuid); > + storage_by_uuid_add_partitions(sbu, cdev); > + return; > } > } > > -- > 2.39.5 > > >