From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com [209.85.167.43]) by mx.groups.io with SMTP id smtpd.web10.98478.1674811791016216494 for ; Fri, 27 Jan 2023 01:29:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bDdBBYQZ; spf=pass (domain: gmail.com, ip: 209.85.167.43, mailfrom: savvamtr@gmail.com) Received: by mail-lf1-f43.google.com with SMTP id d30so7204309lfv.8 for ; Fri, 27 Jan 2023 01:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kQ19lo8EztfRE6UKdrQiBpaGofHhXUDVGZViAWF/MHg=; b=bDdBBYQZc3/qqrQcj3ksWEeUhQNxB0F+jdCQIKuqvEJ27p7OBL+PrUX4hu1zSdpoS7 UUZJUexLUGqBQBaGYtrRkdFsm46NnJhhjjVKx249E4sLkpftIRelA7KR/hwIEVO5Ka3r RSxni76OGHC4M6yGDLeGS0vyAkLl7pG26p7Elsyj+YwzFo4TSZo3oOtvPVby0iUQp9ne oBQVRm+lu2PVoEJtQWdHdHX6PE1sGeIdXiD7lItvFdMbRgv1+n2RVs7LGJIiU5mT9guS t84UgMPyiijUu8GQBT0pEimv1MotMUf5mpwJIOu9FHq8M7nvLEygcePtfTsc6/Rf/70O 6xgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kQ19lo8EztfRE6UKdrQiBpaGofHhXUDVGZViAWF/MHg=; b=x+xfkWC8+IGgcavFLF3Xuj0Q0aEbWt8JZldf58gV5+jXtw4cUnONu7MAemVV3k2Aca 6aNdmXxBp/JIWBd9yfKtl8tbuL0TPqUubI7t/Ah9nFDt5KrF0g6+u2beIVufuGRQcWUM qW+3ZgGYrCBV8x9InrM6nQ7RgQ94zVoI9PETXun6KQZ9KqDbV+VaiFrXlbeF/2EvNgZ8 eP0qVlxkG6Sf36UCCImBhuZar6F6XwVyA/u1aqNnkL3JBQUp8fVWYj8vn55QRxl6om0V DiPdfXyd2/aJE6uESKS/033PLQA7iEUqCNIxJ3AKYZU1HB9m1Dxa+d2zRCG+NEbK4YiN sdMg== X-Gm-Message-State: AFqh2krXeufaBQxlMcsdRKGnAhahdiByXGwAM2eKqjE4XEzVonQsAuEs YxCzv1Dnc4LNoI/uSPv8dLqcjJZBIV8Gh/+Y X-Google-Smtp-Source: AMrXdXvoxL1NGvGk/FUVL+BEoKEX+bp0mfFDF6sDIXtspZ47QGiqYgCt2waa/QphK9s+F9u6ED05ng== X-Received: by 2002:a05:6512:3048:b0:4b9:a91c:b0c9 with SMTP id b8-20020a056512304800b004b9a91cb0c9mr13230709lfb.7.1674811789233; Fri, 27 Jan 2023 01:29:49 -0800 (PST) Return-Path: Received: from localhost.localdomain ([176.62.67.29]) by smtp.gmail.com with ESMTPSA id t11-20020a056512068b00b004cc8196a308sm229071lfe.98.2023.01.27.01.29.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 27 Jan 2023 01:29:48 -0800 (PST) From: "Savva Mitrofanov" To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20H=C3=A4user?= , Pedro Falcato , Vitaly Cheptsov Subject: [edk2-platforms][PATCH v3 02/11] Ext4Pkg: Fix incorrect checksum metadata feature check Date: Fri, 27 Jan 2023 15:29:36 +0600 Message-Id: <20230127092945.94389-3-savvamtr@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230127092945.94389-1-savvamtr@gmail.com> References: <20230127092945.94389-1-savvamtr@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Missing comparison !=3D 0 leads to broken logic condition. Also replaced CSUM_SEED feature_incompat check with predefined macro EXT4_HAS_INCOMPAT Cc: Marvin H=C3=A4user Cc: Pedro Falcato Cc: Vitaly Cheptsov Fixes: d9ceedca6c8f ("Ext4Pkg: Add Ext4Dxe driver.") Signed-off-by: Savva Mitrofanov --- Features/Ext4Pkg/Ext4Dxe/Superblock.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Superblock.c b/Features/Ext4Pkg/Ext4D= xe/Superblock.c index 5a3c7f478187..35dcf3c007c8 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Superblock.c +++ b/Features/Ext4Pkg/Ext4Dxe/Superblock.c @@ -220,13 +220,11 @@ Ext4OpenSuperblock ( }=0D =0D // At the time of writing, it's the only supported checksum.=0D - if (Partition->FeaturesCompat & EXT4_FEATURE_RO_COMPAT_METADATA_CSUM &&= =0D - (Sb->s_checksum_type !=3D EXT4_CHECKSUM_CRC32C))=0D - {=0D + if (EXT4_HAS_METADATA_CSUM (Partition) && (Sb->s_checksum_type !=3D EXT4= _CHECKSUM_CRC32C)) {=0D return EFI_UNSUPPORTED;=0D }=0D =0D - if ((Partition->FeaturesIncompat & EXT4_FEATURE_INCOMPAT_CSUM_SEED) !=3D= 0) {=0D + if (EXT4_HAS_INCOMPAT (Partition, EXT4_FEATURE_INCOMPAT_CSUM_SEED)) {=0D Partition->InitialSeed =3D Sb->s_checksum_seed;=0D } else {=0D Partition->InitialSeed =3D Ext4CalculateChecksum (Partition, Sb->s_uui= d, 16, ~0U);=0D --=20 2.39.0