From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.9181.1592987551767208660 for ; Wed, 24 Jun 2020 01:32:31 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: ray.ni@intel.com) IronPort-SDR: azJaLkbs16HI+BXesgkzke5gVYvPqAV8mR+EnnO8U9SbCiDCKmUDnLmbmJO5Arvb2THxvt1QST MBQiI5ulN7Bg== X-IronPort-AV: E=McAfee;i="6000,8403,9661"; a="143476785" X-IronPort-AV: E=Sophos;i="5.75,274,1589266800"; d="scan'208";a="143476785" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2020 01:32:31 -0700 IronPort-SDR: kVG6OKJM5bQpaJOxH9i4//eFiUZjidCnojG1S8T7dmnc2ie212+i1COWSC+V/60SQwSAzNjUGh H8m7VhOJY83w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,274,1589266800"; d="scan'208";a="265014888" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga008.fm.intel.com with ESMTP; 24 Jun 2020 01:32:31 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Jun 2020 01:32:30 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 24 Jun 2020 01:32:30 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.161]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.85]) with mapi id 14.03.0439.000; Wed, 24 Jun 2020 16:32:27 +0800 From: "Ni, Ray" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: "Wu, Hao A" , "Wang, Jian J" , "Gao, Liming" Subject: Re: [PATCH] MdeModulePkg/PartitionDxe: Seperate the Udf handler Thread-Topic: [PATCH] MdeModulePkg/PartitionDxe: Seperate the Udf handler Thread-Index: AQHWSew7PLCnQJWhREa5iLSmiIY1Kqjnb68g Date: Wed, 24 Jun 2020 08:32:27 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C5D1BBB@SHSMSX104.ccr.corp.intel.com> References: <20200624055610.13984-1-zhichao.gao@intel.com> In-Reply-To: <20200624055610.13984-1-zhichao.gao@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: ray.ni@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Zhichao, Will two BlockIo child devices cover the same range in the ISO after your p= atch? I don't think that's a valid behavior. Thanks, Ray > -----Original Message----- > From: Gao, Zhichao > Sent: Wednesday, June 24, 2020 1:56 PM > To: devel@edk2.groups.io > Cc: Wu, Hao A ; Ni, Ray ; Wang, Jia= n J ; Gao, Liming > > Subject: [PATCH] MdeModulePkg/PartitionDxe: Seperate the Udf handler >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2823 >=20 > Some linux iso like Redhat would contain both MBR info in the first > 512 bytes and volume info at the beginning of 32KB offset. > But the partition driver would only choose one of the GPT, MBR, and > UDF(el torito compatible) to install the partition. That would lose > one info for such linux ISO during one connect. And UDF(el torito > compatible) is not conflicted with MBR/GPT. So partition driver should > check UDF and MBR/GPT separately. >=20 > Cc: Hao A Wu > Cc: Ray Ni > Cc: Jian J Wang > Cc: Liming Gao > Signed-off-by: Zhichao Gao > --- > .../Universal/Disk/PartitionDxe/Partition.c | 52 +++++++++++++------ > 1 file changed, 37 insertions(+), 15 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > index d1c878ad2e..562490db4f 100644 > --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > @@ -5,7 +5,7 @@ > MBR, and GPT partition schemes are supported. >=20 > Copyright (c) 2018 Qualcomm Datacenter Technologies, Inc. > -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> +Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -39,7 +39,6 @@ EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding =3D= { > PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] =3D { > PartitionInstallGptChildHandles, > PartitionInstallMbrChildHandles, > - PartitionInstallUdfChildHandles, > NULL > }; >=20 > @@ -189,6 +188,8 @@ PartitionDriverBindingStart ( > { > EFI_STATUS Status; > EFI_STATUS OpenStatus; > + EFI_STATUS UdfStatus; > + EFI_STATUS GptMbrStatus; > EFI_BLOCK_IO_PROTOCOL *BlockIo; > EFI_BLOCK_IO2_PROTOCOL *BlockIo2; > EFI_DISK_IO_PROTOCOL *DiskIo; > @@ -300,26 +301,47 @@ PartitionDriverBindingStart ( > if (BlockIo->Media->MediaPresent || > (BlockIo->Media->RemovableMedia && !BlockIo->Media->LogicalPartiti= on)) { > // > - // Try for GPT, then legacy MBR partition types, and then UDF and El= Torito. > - // If the media supports a given partition type install child handle= s to > - // represent the partitions described by the media. > + // Try for UDF (El TOrito compatible) and GPT/MBR partition types. > + // If the media supports a given partition type, it would install ch= ild handles > + // to represent the partitions described by the media. > + // Notes: GPT is conflicted with MBR. It would only install one of t= hem to describe > + // the partition. UDF (or El Torito) can exist with MBR, so need to = check it along with > + // GPT/MBR. > // > + UdfStatus =3D PartitionInstallUdfChildHandles ( > + This, > + ControllerHandle, > + DiskIo, > + DiskIo2, > + BlockIo, > + BlockIo2, > + ParentDevicePath > + ); > + > Routine =3D &mPartitionDetectRoutineTable[0]; > while (*Routine !=3D NULL) { > - Status =3D (*Routine) ( > - This, > - ControllerHandle, > - DiskIo, > - DiskIo2, > - BlockIo, > - BlockIo2, > - ParentDevicePath > - ); > - if (!EFI_ERROR (Status) || Status =3D=3D EFI_MEDIA_CHANGED || Stat= us =3D=3D EFI_NO_MEDIA) { > + GptMbrStatus =3D (*Routine) ( > + This, > + ControllerHandle, > + DiskIo, > + DiskIo2, > + BlockIo, > + BlockIo2, > + ParentDevicePath > + ); > + if (!EFI_ERROR (GptMbrStatus) || GptMbrStatus =3D=3D EFI_MEDIA_CHA= NGED || GptMbrStatus =3D=3D EFI_NO_MEDIA) { > break; > } > Routine++; > } > + > + if (!EFI_ERROR (UdfStatus) || !EFI_ERROR (GptMbrStatus)) { > + Status =3D EFI_SUCCESS; > + } else if (UdfStatus =3D=3D EFI_MEDIA_CHANGED || GptMbrStatus =3D=3D= EFI_MEDIA_CHANGED) { > + Status =3D EFI_MEDIA_CHANGED; > + } else if (UdfStatus =3D=3D EFI_NO_MEDIA || GptMbrStatus =3D=3D EFI_= NO_MEDIA) { > + Status =3D EFI_NO_MEDIA; > + } > } > // > // In the case that the driver is already started (OpenStatus =3D=3D E= FI_ALREADY_STARTED), > -- > 2.21.0.windows.1