]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Revert "MdeModulePkg/PartitionDxe: Fix the incorrect LBA size in child ..."
authorZhichao Gao <zhichao.gao@intel.com>
Tue, 20 Oct 2020 01:38:04 +0000 (09:38 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 20 Oct 2020 06:12:12 +0000 (06:12 +0000)
This reverts commit e0eacd7daa6f2e59de2b35a5dfe8bb4c38821e31.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3012

The patch to fix LBA size would cause a regression that make the
partition of CD image with media type other than NO_EMULATOR unobserved.

The 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 <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Tested-by: Gary Lin <glin@suse.com>
MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c

index f10ce7c65bdf9b9c23448b74c94ac984d82c5af9..473e0913200ca0a4d1157c76df6c934edae13019 100644 (file)
@@ -1149,8 +1149,8 @@ PartitionInstallChildHandle (
 \r
   Private->Signature        = PARTITION_PRIVATE_DATA_SIGNATURE;\r
 \r
-  Private->Start            = MultU64x32 (Start, BlockSize);\r
-  Private->End              = MultU64x32 (End + 1, BlockSize);\r
+  Private->Start            = MultU64x32 (Start, ParentBlockIo->Media->BlockSize);\r
+  Private->End              = MultU64x32 (End + 1, ParentBlockIo->Media->BlockSize);\r
 \r
   Private->BlockSize        = BlockSize;\r
   Private->ParentBlockIo    = ParentBlockIo;\r
@@ -1187,7 +1187,13 @@ PartitionInstallChildHandle (
 \r
   Private->Media.IoAlign   = 0;\r
   Private->Media.LogicalPartition = TRUE;\r
-  Private->Media.LastBlock = End - Start;\r
+  Private->Media.LastBlock = DivU64x32 (\r
+                               MultU64x32 (\r
+                                 End - Start + 1,\r
+                                 ParentBlockIo->Media->BlockSize\r
+                                 ),\r
+                                BlockSize\r
+                               ) - 1;\r
 \r
   Private->Media.BlockSize = (UINT32) BlockSize;\r
 \r