From nobody Fri May 3 07:00:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62460+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62460+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594689786; cv=none; d=zohomail.com; s=zohoarc; b=i3zFr51JNhELxyzZP/QVfTyFB0IKXc6CMczFotDZpPtldU1FWm13bdxZU8L7Y5QdtKKsScSpvFQwbCEj0MiW/mog2SKcCne/DLZqwggrfpS2efRydtckivB0R6jfRHuxXQIOiTRIxI+tWTJUerWDjt9KCN5U/OcXboOrOdThto8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594689786; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=qgET61EmM4fXJBm9TJVeKhKtPb+kMJkk0A50WxEEesQ=; b=dIE+75YgOmPwGGIsIZN4AnWKDiLfHKHEsGrLBIcTU46DKIup2d2daoWHfMmYKieuT6bZzzSzG151W/Zxe8kcUi+EVxwsXGKsOnApT7t055+SPxvOVeI0+7hPTRVenBtnu+0LPPmO50OkpfFON+EYxLUtcel3x1qp2SMvUwZrVb0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62460+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594689785969162.95760364030457; Mon, 13 Jul 2020 18:23:05 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tmhdYY1788612xkJcCIILXYr; Mon, 13 Jul 2020 18:23:05 -0700 X-Received: from mga03.intel.com (mga03.intel.com []) by mx.groups.io with SMTP id smtpd.web10.11039.1594689784136109203 for ; Mon, 13 Jul 2020 18:23:04 -0700 IronPort-SDR: uPOdKfdAWwEoEENhwnE9VHOaiO4G2dxkI1w33ll9ChNINqYXMNqfbqDN/f9A3spFmEXV+R6kUn ERTGX7zC7zGw== X-IronPort-AV: E=McAfee;i="6000,8403,9681"; a="148762704" X-IronPort-AV: E=Sophos;i="5.75,349,1589266800"; d="scan'208";a="148762704" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 18:23:04 -0700 IronPort-SDR: rZE69lACWwOhkbmHiMsorOpvYgDpIgpw5V1Mpgj9KZoZVKV2ATOqUrCsZoOlCCgDgRVfFRwjpF /RtzV8DxOwkA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,349,1589266800"; d="scan'208";a="285590329" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.114]) by orsmga006.jf.intel.com with ESMTP; 13 Jul 2020 18:23:03 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH V3 1/3] MdeModulePkg/PartitionDxe: Correct the MBR last block value Date: Tue, 14 Jul 2020 09:22:57 +0800 Message-Id: <20200714012259.30504-2-zhichao.gao@intel.com> In-Reply-To: <20200714012259.30504-1-zhichao.gao@intel.com> References: <20200714012259.30504-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com X-Gm-Message-State: IBPAMdLKe0n41k8G2QfJUocnx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594689785; bh=SyEONorkMuhPW2SFoY8IJ7HQfmSYKMnYZ5mcLlasYCc=; h=Cc:Date:From:Reply-To:Subject:To; b=trYdFV9QPNbYeaFBUSKMzwpieAVs5jhMafP9C5mrJLdWHDH2mvg6p8O2PuFsKuHHPo3 A6O19BwUKZ35EhjKLN5mzxDkLIMe9EzXam4/jzXmMYYHqJ25a07k78ZsA1Hr+0tJlN3Gc cuNA27+iCSf8QSdmPIM10sAt4CBuszBl+Zo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2823 PartitionValidMbr function's second parameter should be the last sector of the device. For MBR partition, the block size is sector size, i.e. 512 bytes. The original value is media block last LBA which is counted by the media block size. And media block size is not always 512 bytes, it may be larger which would cause the MBR boundary check incorrect. The boundary check is based on the partition entry start LBA and size of LBA which are both counted by the sector number (512 bytes). Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Zhichao Gao Reviewed-by: Ray Ni --- MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c b/MdeModulePkg/= Universal/Disk/PartitionDxe/Mbr.c index dac451a144..f0c92aa09a 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c @@ -135,14 +135,17 @@ PartitionInstallMbrChildHandles ( EFI_DEVICE_PATH_PROTOCOL *LastDevicePathNode; UINT32 BlockSize; UINT32 MediaId; - EFI_LBA LastBlock; + EFI_LBA LastSector; EFI_PARTITION_INFO_PROTOCOL PartitionInfo; =20 Found =3D EFI_NOT_FOUND; =20 - BlockSize =3D BlockIo->Media->BlockSize; - MediaId =3D BlockIo->Media->MediaId; - LastBlock =3D BlockIo->Media->LastBlock; + BlockSize =3D BlockIo->Media->BlockSize; + MediaId =3D BlockIo->Media->MediaId; + LastSector =3D DivU64x32 ( + MultU64x32 (BlockIo->Media->LastBlock + 1, BlockSize), + MBR_SIZE + ) - 1; =20 // // Ensure the block size can hold the MBR @@ -167,7 +170,7 @@ PartitionInstallMbrChildHandles ( Found =3D Status; goto Done; } - if (!PartitionValidMbr (Mbr, LastBlock)) { + if (!PartitionValidMbr (Mbr, LastSector)) { goto Done; } // --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62460): https://edk2.groups.io/g/devel/message/62460 Mute This Topic: https://groups.io/mt/75490640/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 3 07:00:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62461+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62461+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594689786; cv=none; d=zohomail.com; s=zohoarc; b=ViIDJRPMTvTCexS0p90RdKHT/MF2H5CjI1j6hNa+LobQqVe0S3cHfSyjEuTlq4DMcFF3HmHi93zE25ChaOVRjzGaVuMkAphGufw0kSJtGQS4KI3eCx1cX47DMuDvRcALMFOqTgd4yCm0hh01f80OFHAZ52RGvpQUl7hmz6tpyL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594689786; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=BPbYb+Ztre4vUojWT4rXMWkFY0CJMIk6+Tw1IzWegMo=; b=jY3GTxm3a2OKLTT2D0zauDsCBFqoWKAgh10QVf4KVWQnTcXI/PwiBeY/1e4KknsSYZLlGOWQj+jzJXtoy0T/Lj0oyPn+6EYzwXym4Z5+NhgryHRvs1snme2CsIIaNPdtwE3FveoZdVLJDmpLRvuAtMo1h9vZbB9wxvhC1S+kS7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62461+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594689786782803.499348630207; Mon, 13 Jul 2020 18:23:06 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id N7gpYY1788612x7Y7lYRc1pX; Mon, 13 Jul 2020 18:23:06 -0700 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web11.10993.1594689785925685440 for ; Mon, 13 Jul 2020 18:23:06 -0700 IronPort-SDR: ISFmfiyh0kAHaUXUHMVshq0WvCGNXOO4MzVSpSx0+Q2JntBS/DH35rD0xmcFFG4+0PIddkYpsa UwQ1QW4yL+Ww== X-IronPort-AV: E=McAfee;i="6000,8403,9681"; a="148762714" X-IronPort-AV: E=Sophos;i="5.75,349,1589266800"; d="scan'208";a="148762714" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 18:23:05 -0700 IronPort-SDR: Ykx0X0uK2aBrc7e7XAmwOqGhPYeAX7G/GO+Cmx7DRD5cHnj2EufuvzlT9UA8rb9e82ZbG7OHcD Rgw2xjSxNryA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,349,1589266800"; d="scan'208";a="285590346" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.114]) by orsmga006.jf.intel.com with ESMTP; 13 Jul 2020 18:23:04 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH V3 2/3] MdeModulePkg/PartitionDxe: Skip the MBR that add for CD-ROM Date: Tue, 14 Jul 2020 09:22:58 +0800 Message-Id: <20200714012259.30504-3-zhichao.gao@intel.com> In-Reply-To: <20200714012259.30504-1-zhichao.gao@intel.com> References: <20200714012259.30504-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com X-Gm-Message-State: jy3GNMy2vZnjP06uEBOIUf5px1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594689786; bh=+Tz6XauPIJ2jwIa3NjiI6/wNP/j09QrzaWlu+ph9lNQ=; h=Cc:Date:From:Reply-To:Subject:To; b=B3qeTkp0dYJYEJoLzoqW9hRmVzchFXFH3VsKo1VouUc4vVuV/Yt0iJ/s20akmauketr sGka5T88tV5YxBRTjT7+UTCu0y7nIo9BRVKm1LbGR9ZZOTh1gjKAbflfpQtsRCHfwNuP7 MnWUQRj+qbyayzmRfmmkZMkVBwxfI2TjEHU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2823 Refer to http://manpages.ubuntu.com/manpages/bionic/man8/mkudffs.8.html. Some Linux ISOs may have the MBR table for compatibility reasons for Windows. The MBR tale would contain the partition entry with start LBA0 and whole media size. There are two methods to check the filesystem in the CD-ROM: 1. MBR partition check (Windows) 2. Whole disk check (MAC OS) UEFI doesn't have the MBR check for UDF and Eltorito. But it may pass the MBR check for such table and fail to detect the filesystem of UDF. Skip the MBR check if the MBR is added for Windows compatiblity so that the partition driver can continue UDF and ElTorito check. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Zhichao Gao Reviewed-by: Ray Ni --- .../Universal/Disk/PartitionDxe/Mbr.c | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c b/MdeModulePkg/= Universal/Disk/PartitionDxe/Mbr.c index f0c92aa09a..3830af1ea7 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c @@ -39,6 +39,7 @@ PartitionValidMbr ( UINT32 StartingLBA; UINT32 EndingLBA; UINT32 NewEndingLBA; + UINT32 SizeInLBA; INTN Index1; INTN Index2; BOOLEAN MbrValid; @@ -51,13 +52,34 @@ PartitionValidMbr ( // MbrValid =3D FALSE; for (Index1 =3D 0; Index1 < MAX_MBR_PARTITIONS; Index1++) { - if (Mbr->Partition[Index1].OSIndicator =3D=3D 0x00 || UNPACK_UINT32 (M= br->Partition[Index1].SizeInLBA) =3D=3D 0) { + StartingLBA =3D UNPACK_UINT32 (Mbr->Partition[Index1].StartingLBA); + SizeInLBA =3D UNPACK_UINT32 (Mbr->Partition[Index1].SizeInLBA); + + // + // If the MBR with partition entry covering the ENTIRE disk, i.e. star= t at LBA0 + // with whole disk size, we treat it as an invalid MBR partition. + // + if ((StartingLBA =3D=3D 0) && + (SizeInLBA =3D=3D (LastLba + 1))) { + // + // Refer to the http://manpages.ubuntu.com/manpages/bionic/man8/mkud= ffs.8.html + // "WHOLE DISK VS PARTITION" + // Some linux ISOs may put the MBR table in the first 512 bytes for = compatibility reasons with Windows. + // Linux kernel ignores MBR table if contains partition which star= ts at sector 0. + // Skip it because we don't have the partition check for UDF(El Tori= to compatible). + // It would continue to do the whole disk check in the UDF routine. + // + DEBUG ((DEBUG_INFO, "PartitionValidMbr: MBR table has partition entr= y covering the ENTIRE disk. Don't treat it as a valid MBR.\n")); + + return FALSE; + } + + if (Mbr->Partition[Index1].OSIndicator =3D=3D 0x00 || SizeInLBA =3D=3D= 0) { continue; } =20 MbrValid =3D TRUE; - StartingLBA =3D UNPACK_UINT32 (Mbr->Partition[Index1].StartingLBA); - EndingLBA =3D StartingLBA + UNPACK_UINT32 (Mbr->Partition[Index1].Si= zeInLBA) - 1; + EndingLBA =3D StartingLBA + SizeInLBA - 1; if (EndingLBA > LastLba) { // // Compatibility Errata: @@ -77,12 +99,15 @@ PartitionValidMbr ( } =20 for (Index2 =3D Index1 + 1; Index2 < MAX_MBR_PARTITIONS; Index2++) { - if (Mbr->Partition[Index2].OSIndicator =3D=3D 0x00 || UNPACK_UINT32 = (Mbr->Partition[Index2].SizeInLBA) =3D=3D 0) { + StartingLBA =3D UNPACK_UINT32 (Mbr->Partition[Index2].StartingLBA); + SizeInLBA =3D UNPACK_UINT32 (Mbr->Partition[Index2].SizeInLBA); + + if (Mbr->Partition[Index2].OSIndicator =3D=3D 0x00 || SizeInLBA =3D= =3D 0) { continue; } =20 - NewEndingLBA =3D UNPACK_UINT32 (Mbr->Partition[Index2].StartingLBA) = + UNPACK_UINT32 (Mbr->Partition[Index2].SizeInLBA) - 1; - if (NewEndingLBA >=3D StartingLBA && UNPACK_UINT32 (Mbr->Partition[I= ndex2].StartingLBA) <=3D EndingLBA) { + NewEndingLBA =3D StartingLBA + SizeInLBA - 1; + if (NewEndingLBA >=3D StartingLBA && StartingLBA <=3D EndingLBA) { // // This region overlaps with the Index1'th region // --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62461): https://edk2.groups.io/g/devel/message/62461 Mute This Topic: https://groups.io/mt/75490641/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 3 07:00:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+62462+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62462+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1594689787; cv=none; d=zohomail.com; s=zohoarc; b=eLIXo9AoBxNhMkvJnuW5RiuZeL++CNfBZPu2w50ELnM+DPriQpzjXsQB4wC6JpfaovhnBH/2EOCtOroSR6PMbYnJJn7CPD7wUfyCWvYuRC30hAw3vjbRgChh1B8RMJVqA/ndHqFp8QN6/y067/kolsoiMlMEoH71VcplKFJtI0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594689787; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=oU7EmedW4FuSlmabbTHaECn2u+0MVomLeELe8QpD/wg=; b=RdzYLKzcAPRTCCCNlIuMsADopGDMuGpCScvY2Iy8Wiew2tiBJBpR8xObminTXtvwuE9bcnMqUMJfgUltEw67wvRtXfub+O+61GvIaFRPVbaxkl5nBgEf1lUGDWHEWI5nLaixl0ob1LzFjPnzPM5PVWkue8bi7akVU9alNkDsj+w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+62462+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1594689787773724.3361187126943; Mon, 13 Jul 2020 18:23:07 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id dpAOYY1788612xUeFV3aTAtd; Mon, 13 Jul 2020 18:23:07 -0700 X-Received: from mga03.intel.com (mga03.intel.com []) by mx.groups.io with SMTP id smtpd.web11.10993.1594689785925685440 for ; Mon, 13 Jul 2020 18:23:07 -0700 IronPort-SDR: jDlctjLHcTmbwaBo4MfLXdKpetu8ybTDzBmGEna/oZ+vXYu8C6IqU88MO9ZVTsO0S3PhDHpwcC rATLqadHmiVQ== X-IronPort-AV: E=McAfee;i="6000,8403,9681"; a="148762720" X-IronPort-AV: E=Sophos;i="5.75,349,1589266800"; d="scan'208";a="148762720" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2020 18:23:06 -0700 IronPort-SDR: A3LycmX4Lso7B17XLZ1WljRuw7qfI//F4YlNIrfa3Op96nr3EYDH8qWT/VjWw+6pwuCKasmuIo A/bKYpToYgFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,349,1589266800"; d="scan'208";a="285590362" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.114]) by orsmga006.jf.intel.com with ESMTP; 13 Jul 2020 18:23:05 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Hao A Wu , Ray Ni Subject: [edk2-devel] [PATCH V3 3/3] MdeModulePkg/PartitionDxe: Add already start check for child hanldes Date: Tue, 14 Jul 2020 09:22:59 +0800 Message-Id: <20200714012259.30504-4-zhichao.gao@intel.com> In-Reply-To: <20200714012259.30504-1-zhichao.gao@intel.com> References: <20200714012259.30504-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com X-Gm-Message-State: F5qOKrmienzctAhOAklhWzVVx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1594689787; bh=nesSylURdvOyU0ZzcWjIrroWYKDDfyeHJl9kQPS++lc=; h=Cc:Date:From:Reply-To:Subject:To; b=sZF88Utl3OvpfVcRabSf/G8ma+xT+OPzjiHQCwjmhRUCjaicz91XEHC1M/nLRp6rvfa 4UTYgMPDYBZHFqCOnXzan4CQ93EAPX0b24+bI1JWHlbM4ZyRAcNzTB92BglFba7tGA+95 zkPmHotGzWDi4TK+8qL8nBwbn5uCjFKePLE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2823 Treat the EFI_ALREADY_STARTED as EFI_SUCCESS to avoid the partition driver continuely check next routine function. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Zhichao Gao Reviewed-by: Hao A Wu --- MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModu= lePkg/Universal/Disk/PartitionDxe/Partition.c index d1c878ad2e..6a43c3cafb 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c @@ -1276,6 +1276,15 @@ PartitionInstallChildHandle ( } else { FreePool (Private->DevicePath); FreePool (Private); + + // + // if the Status =3D=3D EFI_ALREADY_STARTED, it means the child handles + // are already installed. So return EFI_SUCCESS to avoid do the next + // partition type check. + // + if (Status =3D=3D EFI_ALREADY_STARTED) { + Status =3D EFI_SUCCESS; + } } =20 return Status; --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#62462): https://edk2.groups.io/g/devel/message/62462 Mute This Topic: https://groups.io/mt/75490642/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-