Seems that returning maximum uintn in case of bad block was a mistake, so return just bad block type
Cc: Marvin Häuser <mhaeu...@posteo.de> Cc: Pedro Falcato <pedro.falc...@gmail.com> Cc: Vitaly Cheptsov <vit9...@protonmail.com> Signed-off-by: Savva Mitrofanov <savva...@gmail.com> --- Features/Ext4Pkg/Ext4Dxe/BlockMap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/BlockMap.c b/Features/Ext4Pkg/Ext4Dxe/BlockMap.c index 3d9e16035bee..2bc629fe9d38 100644 --- a/Features/Ext4Pkg/Ext4Dxe/BlockMap.c +++ b/Features/Ext4Pkg/Ext4Dxe/BlockMap.c @@ -123,7 +123,7 @@ Ext4GetBlockPath ( break; default: // EXT4_TYPE_BAD_BLOCK - return -1; + break; } return Type + 1; @@ -230,7 +230,7 @@ Ext4GetBlocks ( BlockPathLength = Ext4GetBlockPath (Partition, LogicalBlock, BlockPath); - if (BlockPathLength == (UINTN)-1) { + if (BlockPathLength - 1 == EXT4_TYPE_BAD_BLOCK) { // Bad logical block (out of range) return EFI_NO_MAPPING; } -- 2.37.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91655): https://edk2.groups.io/g/devel/message/91655 Mute This Topic: https://groups.io/mt/92531471/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-