From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) by mx.groups.io with SMTP id smtpd.web12.39756.1658232648358838173 for ; Tue, 19 Jul 2022 05:10:48 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kuX7R6Z2; spf=pass (domain: gmail.com, ip: 209.85.208.175, mailfrom: savvamtr@gmail.com) Received: by mail-lj1-f175.google.com with SMTP id q7so17089622lji.12 for ; Tue, 19 Jul 2022 05:10:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6evBkn7Ec44XCMUiKpoAtMtq7Wr5um6FL1dycw+8LPs=; b=kuX7R6Z2FhAtXhS+XRCgR4jyx8+sg+xVYnSRamH3tuMcirpfq3ZR43o8gd9VSs/NbI i3TcXVax3xxVGNdvOD6k3Csmc8V0sit8nsFQwlaTucDRLOuABkoqdx/qUyEbiLOs7++r Oggr0mzvyMHKxNeD9YRBXmKJtdR3f+e51mNYihHZgPBNz5D4CcKXQA5PYPwJsjA3hTtX cfYuokYmaPZRq8VfwzzXeMCJj9ysVw+FeCC+qswIA46Es0ChMxV9TpaW0E1zVPYOiPpV 3pAVKoPVj/Wh+FherAlDg0nUZbpQf8U/NwbKUWftWRVtT5TIcMKeQ8tA4xtVo0QBUjnw 8Z1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6evBkn7Ec44XCMUiKpoAtMtq7Wr5um6FL1dycw+8LPs=; b=OZKbRy+hYbhsxHMK1u3gkc0lSUDTKN7jjxnJEq+K69Z6hg8yShF0sIfzGGFiNh/Z5D vpYreMZhtRcsShdp4XMLQ+EYF3AVeblOppLTWTlFw7JKzG4tzTLfTaX56dTr5SYvDcm3 8oGL83prWQTYkgD0mt6viC93uNrKFYi5NdE4lIrKBrBFSgZUTTWOZlw2z7jZ2csTgMpL 2jmjcO8ht+5nTUmKCi1FBpXer21gxPKuAT8tiEMDcbf0FgLH8WkCSKojjpb6lcuQ/J2m KmojgJg592tbzbvJy6mOybmrN8my6KHO2hoSEFiLlGHNjBhRhffnKznQ54buXszrrI7E ZmHA== X-Gm-Message-State: AJIora8Q5UgEvOAT6RT0Xqo6lSxw5vVqYe110aUwLlBteTYO/xr1mtQZ V0TOpmdCmO8EYw9RzI6kZMOKYzawUBwli3l6pLc= X-Google-Smtp-Source: AGRyM1sgWL7vG7kZrOZOAB787PZIW7lQSUZgaYvbye3gxW1HkgTJTY5pU0nyu7yrkKVorDSJZHXVXA== X-Received: by 2002:a2e:87c8:0:b0:25d:776c:8343 with SMTP id v8-20020a2e87c8000000b0025d776c8343mr14253051ljj.268.1658232646513; Tue, 19 Jul 2022 05:10:46 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([207.180.219.167]) by smtp.gmail.com with ESMTPSA id z20-20020a2eb534000000b0025d6ecbc897sm2668245ljm.46.2022.07.19.05.10.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2022 05:10:46 -0700 (PDT) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-platforms][PATCH 09/10] Ext4Pkg: Return bad block type in Ext4GetBlockpath Date: Tue, 19 Jul 2022 18:10:15 +0600 Message-Id: <20220719121016.29380-10-savvamtr@gmail.com> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220719121016.29380-1-savvamtr@gmail.com> References: <20220719121016.29380-1-savvamtr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Seems that returning maximum uintn in case of bad block was a mistake, so return just bad block type Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Signed-off-by: Savva Mitrofanov --- 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;=0D default:=0D // EXT4_TYPE_BAD_BLOCK=0D - return -1;=0D + break;=0D }=0D =0D return Type + 1;=0D @@ -230,7 +230,7 @@ Ext4GetBlocks ( =0D BlockPathLength =3D Ext4GetBlockPath (Partition, LogicalBlock, BlockPath= );=0D =0D - if (BlockPathLength =3D=3D (UINTN)-1) {=0D + if (BlockPathLength - 1 =3D=3D EXT4_TYPE_BAD_BLOCK) {=0D // Bad logical block (out of range)=0D return EFI_NO_MAPPING;=0D }=0D --=20 2.37.0