From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.10589.1597133301092695501 for ; Tue, 11 Aug 2020 01:08:21 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: ray.ni@intel.com) IronPort-SDR: UJPyLG8uSBNOQWQYjZnOJPAg+xK2mp8V0k2StJIUvzomL6oMPrayyV05j3hoR4MNGc/JtT2yaI dH92SoSnpUAw== X-IronPort-AV: E=McAfee;i="6000,8403,9709"; a="133743061" X-IronPort-AV: E=Sophos;i="5.75,460,1589266800"; d="scan'208";a="133743061" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2020 01:08:20 -0700 IronPort-SDR: /NzVfRaf2S2U9+ITlUyAzlwUEOvS+UU1jcPFg+7R9L5T7KDBDcO7UkPKzcPhv5vOmPxgSPO4Ue lzYjhM3tVPNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,460,1589266800"; d="scan'208";a="290620740" Received: from unknown (HELO fmsmsx604.amr.corp.intel.com) ([10.18.84.214]) by orsmga003.jf.intel.com with ESMTP; 11 Aug 2020 01:08:19 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 11 Aug 2020 01:08:18 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 11 Aug 2020 01:08:18 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Aug 2020 01:08:18 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.70]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.49]) with mapi id 14.03.0439.000; Tue, 11 Aug 2020 16:08:15 +0800 From: "Ni, Ray" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Wu, Hao A" , Gary Lin , Andrew Fish Subject: Re: [PATCH 3/3] MdeModulePkg/PartitionDxe: Fix the incorrect LBA size in child hander Thread-Topic: [PATCH 3/3] MdeModulePkg/PartitionDxe: Fix the incorrect LBA size in child hander Thread-Index: AQHWb6q1L99P+dT2h0WQUdktLiE4JakyjXtw Date: Tue, 11 Aug 2020 08:08:15 +0000 Deferred-Delivery: Tue, 11 Aug 2020 08:08:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5C668982@SHSMSX104.ccr.corp.intel.com> References: <20200811064302.33188-1-zhichao.gao@intel.com> <20200811064302.33188-4-zhichao.gao@intel.com> In-Reply-To: <20200811064302.33188-4-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.5.1.3 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 Reviewed-by: Ray Ni > -----Original Message----- > From: Gao, Zhichao > Sent: Tuesday, August 11, 2020 2:43 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ;= Ni, Ray ; Gary Lin > ; Andrew Fish > Subject: [PATCH 3/3] MdeModulePkg/PartitionDxe: Fix the incorrect LBA siz= e in child hander >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2843 >=20 > PartitionInstallChildHandle's parameters Start and End is counted > by the BlockSize, but in the implementation it uses the parent > device's BlockSize to calculate the new Start, End and LastBlock. > It would cause the driver report incorrect block scope and the file > system would fail to be found with right block scope. > So correct it to the right value. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Ray Ni > Cc: Gary Lin > Cc: Andrew Fish > Signed-off-by: Zhichao Gao > --- > MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > index 473e091320..f10ce7c65b 100644 > --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c > @@ -1149,8 +1149,8 @@ PartitionInstallChildHandle ( >=20 > Private->Signature =3D PARTITION_PRIVATE_DATA_SIGNATURE; >=20 > - Private->Start =3D MultU64x32 (Start, ParentBlockIo->Media-= >BlockSize); > - Private->End =3D MultU64x32 (End + 1, ParentBlockIo->Medi= a->BlockSize); > + Private->Start =3D MultU64x32 (Start, BlockSize); > + Private->End =3D MultU64x32 (End + 1, BlockSize); >=20 > Private->BlockSize =3D BlockSize; > Private->ParentBlockIo =3D ParentBlockIo; > @@ -1187,13 +1187,7 @@ PartitionInstallChildHandle ( >=20 > Private->Media.IoAlign =3D 0; > Private->Media.LogicalPartition =3D TRUE; > - Private->Media.LastBlock =3D DivU64x32 ( > - MultU64x32 ( > - End - Start + 1, > - ParentBlockIo->Media->BlockSize > - ), > - BlockSize > - ) - 1; > + Private->Media.LastBlock =3D End - Start; >=20 > Private->Media.BlockSize =3D (UINT32) BlockSize; >=20 > -- > 2.21.0.windows.1