From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.50]) by mx.groups.io with SMTP id smtpd.web11.9.1631220071994141679 for ; Thu, 09 Sep 2021 13:41:12 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nvidia.com header.s=selector2 header.b=APm0E6ir; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.94.50, mailfrom: jbrasen@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NtQhbonpJHMiFiInA2U1tUU2dgelncSwdv8p/0w0A90JZ+LTgum4uW3zm+YvOiGPv1AosyapInvthS/SAzm9NzLP35/5u8Z0sCDperm6UvCyg81jCuc8owxaxeqVw7mMEdQfL0PGa3ZuVZjcwDbBRf8eOPEtN5paEkIA8ZAeWOfOc8n/7WOBuiFQTTEwNOC4m0d5/MNfCpU3ydFDMm5tZ8nFMTZiie9MVf4IXd52gNm8jGyVnKRTo49aL9or21vhBkH5aEINR77csJTBymuxUSuxEp1B6CmM68iRqe05oX6YZrHnnp4n6cxY+wAWQZYzTlEoDvGMjVcWml3ECUquFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Vgz1u6u7htS2t5EJpCf5hYFfMcSp+Shug3kPHpghzrY=; b=JFYt8SNsJKJKc2QRGElDQGAHsJ6pTrlYH3MaoRFoUhKdjiMTey1iK5c4K/tkZLe3w70FRzq0iBdXsLmCJKiwQF133GP8Bcs37IfMqvkJZsnaUGFoqTDQ9+JR7ah9RO07GnS6TcPxJDamQhobotFO+ADsFIc5wjv3Ix16BwSDXcVqLX6694oYAZtks4NcX3OAuzhq3ZJFwZwjx3UgEBZiiE4pXpsbLCsvMOJrPaX1tUmYv8MEyomDb5eTPIEcTC1YQ35h5e/1FRyqsaxmAGHYa7XJdbZ6PNXGbgrbtU8Jh2XBMzL1JlsGxnipdVmxOS/3lqWdQ4a21EA9SGXMtgDHFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.32) smtp.rcpttodomain=gmail.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vgz1u6u7htS2t5EJpCf5hYFfMcSp+Shug3kPHpghzrY=; b=APm0E6irVdib956iCxq3iqTzeogwQ2NWHGslrG5BabIi23yCrVVvca3AZkb7LUtjcHeOVpNPuMaV7zgZqfs6bX7oZnFM5jY9iwhJNhdSHy0R5CcgbHhszrwTTNxlKL6npWz9bAcly7p/09MTul/OZtRixSiGqj7v60TQLlzymlz+3bavLXwxULAl2iITPSiF5PXwk2MIqm39Uq+XD1A4bUn2cZSc+nRLf0NELDdyfKczyIc5XLRwDnIaDXH3Mit1sa0mhYRz5sqBiGucngzgtzGMGzCLGzuL8iMXg7Mo5ItMHZBThbd4ZWuvn46QuIGgVIgqxZZ2TUJ+9UpQhzfr3g== Received: from BN9PR03CA0228.namprd03.prod.outlook.com (2603:10b6:408:f8::23) by MN2PR12MB3391.namprd12.prod.outlook.com (2603:10b6:208:c3::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.19; Thu, 9 Sep 2021 20:41:09 +0000 Received: from BN8NAM11FT037.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f8:cafe::59) by BN9PR03CA0228.outlook.office365.com (2603:10b6:408:f8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.16 via Frontend Transport; Thu, 9 Sep 2021 20:41:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.32) smtp.mailfrom=nvidia.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.32 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.32; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.32) by BN8NAM11FT037.mail.protection.outlook.com (10.13.177.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4500.14 via Frontend Transport; Thu, 9 Sep 2021 20:41:09 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 9 Sep 2021 13:41:09 -0700 Received: from build-jbrasen-20210819T103534360.nvidia.com (172.20.187.6) by mail.nvidia.com (172.20.187.13) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 9 Sep 2021 20:41:09 +0000 From: "Jeff Brasen" To: CC: , Jeff Brasen Subject: [PATCH 2/2] Ext4Pkg: Support non-cleanlty unmounted filesystems Date: Thu, 9 Sep 2021 20:41:01 +0000 Message-ID: <36024a6bf15f115313e6fa134ee44dc6002de740.1631219610.git.jbrasen@nvidia.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 In-Reply-To: References: X-NVConfidentiality: public Return-Path: jbrasen@nvidia.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 484c7323-a037-41c3-b747-08d973d227b7 X-MS-TrafficTypeDiagnostic: MN2PR12MB3391: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2331; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OcALm7OLneplco/kNJ1k6LHmgtpm0CIV80+hnqaCLtpLTcD+6ZCLh6X891Oak29a8LRTVRwy+2EP0hPLEc5DptMc3meFrvJOeAodt0DoB/TDQHYnuyiYIu77TF5Wk3dEPxF0RF33BA2sP4LCaR3+MyQye7TxqaF7unr0VifbXSDYd7NQYlwNsdKCl3FN4Nz0v69MxEwnwOchx+xrkrkSuhg/kMR9+51o/egdO4Ybwd6fabiXZQLlpxNWW7MG7DciXEmTBy1Kvqwcku1vFUZR2NOIemfhrJtEOGsZ+xqdrd6CpvRQmdiSvrLfkKWN21ELDlHdKjpMK3TC6jNzkz9ExnNOxRnIb0PypLp75Es31+SPYUyJnyrb+Do5FTo9Ijygp+FQqhUprDTxacawB/fAX+frSbnOaAtTUT5QGIBrY3UZnkzfrUHIWn5kRWPuQyS+78Ityl2mfmm8pRLuTRccIb23NpSWQ4f8RGIWdybsWDs19s4kscLt0V6Jx6Mrg40WA8tyHpENb4BlPWFvBVlGOkCK2rFDUo3ej6aXLJtaMV8wkaWPMkNRhWr3FG+uGoKuCU4B240vX1mfKg0GdWQzLZ/Drt2Hvw2mu+1htyp4T5uumkRT+NMo1W5Re/Xscu3YWBSnkBKhiWS6T3GpqeJzMRFrVX+6j9Xmzl/oEu5+XC96tACj+AsLEf1iXoRznoFzyevSeLr2Yt3efqRgmSAHo8z88ExaycKNoXB+dRALv5U= X-Forefront-Antispam-Report: CIP:216.228.112.32;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid01.nvidia.com;CAT:NONE;SFS:(4636009)(346002)(39860400002)(376002)(396003)(136003)(46966006)(36840700001)(186003)(6916009)(336012)(426003)(2616005)(478600001)(26005)(8936002)(70586007)(70206006)(5660300002)(86362001)(83380400001)(54906003)(316002)(36756003)(2906002)(82310400003)(8676002)(6666004)(107886003)(4326008)(19627235002)(7696005)(82740400003)(356005)(36860700001)(7636003)(47076005)(32563001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2021 20:41:09.4774 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 484c7323-a037-41c3-b747-08d973d227b7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.32];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT037.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3391 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Support for uncleanly mounted filesystems, if there is a recovery journal mark filesystem as read-only. Signed-off-by: Jeff Brasen --- Features/Ext4Pkg/Ext4Dxe/Superblock.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Superblock.c b/Features/Ext4Pkg/Ext4D= xe/Superblock.c index 1f8cdd3705..444dd3ca97 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Superblock.c +++ b/Features/Ext4Pkg/Ext4Dxe/Superblock.c @@ -18,7 +18,7 @@ STATIC CONST UINT32 gSupportedIncompatFeat =3D EXT4_FEATURE_INCOMPAT_64BIT | EXT4_FEATURE_INCOMPAT_DIRDATA | EXT4_FEATURE_INCOMPAT_FLEX_BG | EXT4_FEATURE_INCOMPAT_FILETYPE | EXT4_FEATURE_INCOMPAT_EXTENTS | EXT4_FEATURE_INCOMPAT_LARGEDIR | - EXT4_FEATURE_INCOMPAT_MMP; + EXT4_FEATURE_INCOMPAT_MMP | EXT4_FEATURE_INCOMPAT_RECOVER; =20 // Future features that may be nice additions in the future: // 1) Btree support: Required for write support and would speed up lookups= in large directories. @@ -88,10 +88,8 @@ Ext4SuperblockValidate ( return FALSE; } =20 - // Is this correct behaviour? Imagine the power cuts out, should the sys= tem fail to boot because - // we're scared of touching something corrupt? if ((Sb->s_state & EXT4_FS_STATE_UNMOUNTED) =3D=3D 0) { - return FALSE; + DEBUG ((DEBUG_WARN, "[ext4] filesystem was not unmounted cleanly\n")); } =20 return TRUE; @@ -214,6 +212,11 @@ Ext4OpenSuperblock ( return EFI_UNSUPPORTED; } =20 + if ((Partition->FeaturesIncompat & EXT4_FEATURE_INCOMPAT_RECOVER) =3D=3D= EXT4_FEATURE_INCOMPAT_RECOVER) { + DEBUG ((DEBUG_WARN, "[ext4] Needs journal recovery mount read-only\n")= ); + Partition->ReadOnly =3D TRUE; + } + // At the time of writing, it's the only supported checksum. if (Partition->FeaturesCompat & EXT4_FEATURE_RO_COMPAT_METADATA_CSUM && Sb->s_checksum_type !=3D EXT4_CHECKSUM_CRC32C) { --=20 2.17.1