public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/PartitionDxe: Revert the child handler blocksize change
@ 2020-10-12  7:22 Gao, Zhichao
  2020-10-13  2:54 ` Ni, Ray
  2020-10-15 10:17 ` Laszlo Ersek
  0 siblings, 2 replies; 16+ messages in thread
From: Gao, Zhichao @ 2020-10-12  7:22 UTC (permalink / raw)
  To: devel; +Cc: Ray Ni, Hao A Wu

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 <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-10-22  5:36 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-12  7:22 [PATCH] MdeModulePkg/PartitionDxe: Revert the child handler blocksize change Gao, Zhichao
2020-10-13  2:54 ` Ni, Ray
2020-10-14  5:58   ` [edk2-devel] " Zhiguang Liu
2020-10-15 10:17 ` Laszlo Ersek
2020-10-16  6:42   ` Gary Lin
2020-10-19  2:45     ` Gao, Zhichao
2020-10-19  5:56       ` Ni, Ray
2020-10-19  9:35         ` Gao, Zhichao
2020-10-19 13:12           ` Laszlo Ersek
2020-10-20  1:06             ` Gao, Zhichao
2020-10-20  9:52         ` Laszlo Ersek
2020-10-21  1:33           ` Gao, Zhichao
2020-10-21 12:26             ` Laszlo Ersek
2020-10-22  5:36               ` Gao, Zhichao
2020-10-19 12:46     ` Laszlo Ersek
2020-10-19  2:41   ` Gao, Zhichao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox