From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.35410.1602487379796370747 for ; Mon, 12 Oct 2020 00:23:00 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.100, mailfrom: zhichao.gao@intel.com) IronPort-SDR: qZH8PWKdzwyaCAFZhoXTWFCVlPn6S80mZB/jJtcBeJhJWnstS1KcekmU75irUU/3/RSaiPJiN1 dzUbJgJdAZYg== X-IronPort-AV: E=McAfee;i="6000,8403,9771"; a="229882955" X-IronPort-AV: E=Sophos;i="5.77,366,1596524400"; d="scan'208";a="229882955" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2020 00:22:55 -0700 IronPort-SDR: GijlnCIADZWJAk97APt0ASWc5lq8/qfjjJkQdsrTobgiQkv/61sUAHKYJxFY0OnIQaTEnuDwCW MgmUZ7a+I1UQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,366,1596524400"; d="scan'208";a="529850595" Received: from fieedk001.ccr.corp.intel.com ([10.239.153.108]) by orsmga005.jf.intel.com with ESMTP; 12 Oct 2020 00:22:54 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Ray Ni , Hao A Wu Subject: [PATCH] MdeModulePkg/PartitionDxe: Revert the child handler blocksize change Date: Mon, 12 Oct 2020 15:22:30 +0800 Message-Id: <20201012072230.46152-1-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2843 Revert the patch to change the block size in child handler. It would block the CD (Eltorito) Hard disk media type's sub partition being observed. The blocksize patch used to fix the CD image's MBR table issue. The CD MBR table would always be ignored because it would be handled by the Eltorito partition handler first and never go into the MBR handler. So directly revert it. Cc: Ray Ni Cc: Hao A Wu Signed-off-by: Zhichao Gao --- MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c index f10ce7c65b..473e091320 100644 --- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c +++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c @@ -1149,8 +1149,8 @@ PartitionInstallChildHandle ( Private->Signature = PARTITION_PRIVATE_DATA_SIGNATURE; - Private->Start = MultU64x32 (Start, BlockSize); - Private->End = MultU64x32 (End + 1, BlockSize); + Private->Start = MultU64x32 (Start, ParentBlockIo->Media->BlockSize); + Private->End = MultU64x32 (End + 1, ParentBlockIo->Media->BlockSize); Private->BlockSize = BlockSize; Private->ParentBlockIo = ParentBlockIo; @@ -1187,7 +1187,13 @@ PartitionInstallChildHandle ( Private->Media.IoAlign = 0; Private->Media.LogicalPartition = TRUE; - Private->Media.LastBlock = End - Start; + Private->Media.LastBlock = DivU64x32 ( + MultU64x32 ( + End - Start + 1, + ParentBlockIo->Media->BlockSize + ), + BlockSize + ) - 1; Private->Media.BlockSize = (UINT32) BlockSize; -- 2.21.0.windows.1