From patchwork Fri Jun 21 13:35:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 1120301 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="YzMyL1XQ"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45Vg114YTrz9sP8 for ; Fri, 21 Jun 2019 23:45:09 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 01422C21E8A; Fri, 21 Jun 2019 13:37:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A6E30C21E96; Fri, 21 Jun 2019 13:37:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 27FF4C21EC2; Fri, 21 Jun 2019 13:35:54 +0000 (UTC) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lists.denx.de (Postfix) with ESMTPS id 67D30C21E1B for ; Fri, 21 Jun 2019 13:35:53 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20190621133552euoutp01c5ea156f4400ba6d3a8f1376faafe75f~qOiVAhUM50359903599euoutp01w; Fri, 21 Jun 2019 13:35:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20190621133552euoutp01c5ea156f4400ba6d3a8f1376faafe75f~qOiVAhUM50359903599euoutp01w DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1561124152; bh=BPP8/F03Hbyt9j/8+yUKeXuTa1OhE0WeZI50mQULjnM=; h=From:To:Cc:Subject:Date:References:From; b=YzMyL1XQSVTtfMJt83wnV4sPojIUgftfjBPvWPBPG+fKbSXE/Uyj5LNvIWHoFpq+z aS+hZMPWRd1+2X9ik7rwQmZGZVUrX7sktZsJfSyzOMKyRpGuxzp7jivUGgF2jWu95O o+9WiP0sRBff6W/Bedd2xKYJ5rzw4BvlaymA38Gg= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190621133552eucas1p2d40b5768d107a17c1d05c012e6607e49~qOiUoAHee0510905109eucas1p2P; Fri, 21 Jun 2019 13:35:52 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 93.BE.04298.73DDC0D5; Fri, 21 Jun 2019 14:35:51 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20190621133551eucas1p210d2a66b8ee29eaf250fe63a053c9cb4~qOiT_HAfU0306803068eucas1p2p; Fri, 21 Jun 2019 13:35:51 +0000 (GMT) X-AuditID: cbfec7f2-f13ff700000010ca-de-5d0cdd379736 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 95.F3.04140.73DDC0D5; Fri, 21 Jun 2019 14:35:51 +0100 (BST) Received: from AMDC2765.DIGITAL.local ([106.120.51.73]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PTG00H1AB3NFH00@eusync1.samsung.com>; Fri, 21 Jun 2019 14:35:51 +0100 (BST) From: Marek Szyprowski To: u-boot@lists.denx.de Date: Fri, 21 Jun 2019 15:35:35 +0200 Message-id: <20190621133535.673-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeLIzCtJLcpLzFFi42LZduzneV3zuzyxBnve61tsnLGe1eLgjz1s Fjd+tbFarD1yl91ixuSXQO70FlaLt3s72R3YPc7e2cHo0dv8js1j38odTB59W1YxBrBEcdmk pOZklqUW6dslcGVceHCPpWAtV8WX7btYGhifcHQxcnJICJhINHXPZ+1i5OIQEljBKLGmv5MF wvnMKNE++SMjTNWHyWcZIRLLGCUmTNjDDuH8Z5Q4uuU7WBWbgKFE19suNhBbREBC4lf/VbAO ZoGJTBJnNy9kAUkICzhJ/Jh2GayBRUBVoufvZbAGXgFrieufb7JDrJOXWL3hADNIs4TAU1aJ E98eMUEkXCRezHjJCmHLSFye3M0CUdTMKPHw3Fp2CKeHUeJy0wyoy60lDh+/CNbBLMAnMWnb dKCxHEBxXomONiGIEg+JZ892gm0WEoiV6NrbzzKBUXwBI8MqRvHU0uLc9NRiw7zUcr3ixNzi 0rx0veT83E2MwGg6/e/4px2MXy8lHWIU4GBU4uE9MIs7Vog1say4MvcQowQHs5IIL08OT6wQ b0piZVVqUX58UWlOavEhRmkOFiVx3mqGB9FCAumJJanZqakFqUUwWSYOTqkGRlvzdsFCVckI //WdUUwGT176lrvNL53Q9i8gt4ZxQ1iz+82XZzo0dz+7W376kMyif3NXr+DeVuIocGWx3VJu /znNbDNn+V+x3HxtPtuHlQ0BLIm8llJ7yy1apWecZv1lxs9xZ7/kZ2cOk2eLi2L6UqIPi1lK S5z+/PHj/hV71yg+37ogPuK7uBJLcUaioRZzUXEiAFXGJjSiAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDJMWRmVeSWpSXmKPExsVy+t/xy7rmd3liDSbPZbHYOGM9q8XBH3vY LG78amO1WHvkLrvFjMkvgdzpLawWb/d2sjuwe5y9s4PRo7f5HZvHvpU7mDz6tqxiDGCJ4rJJ Sc3JLEst0rdL4Mq48OAeS8Faroov23exNDA+4ehi5OSQEDCR+DD5LGMXIxeHkMASRonHy/Yy QTiNTBKPNz5gBKliEzCU6HrbxQZiiwhISPzqvwrWwSwwmUni3++tTCAJYQEniR/TLoM1sAio SvT8vQzWwCtgLXH98012iHXyEqs3HGCewMi1gJFhFaNIamlxbnpusZFecWJucWleul5yfu4m RmAYbDv2c8sOxq53wYcYBTgYlXh4D8zijhViTSwrrsw9xCjBwawkwsuTwxMrxJuSWFmVWpQf X1Sak1p8iFGag0VJnLdD4GCMkEB6YklqdmpqQWoRTJaJg1OqgfGMrbdaaLZ639r7s1bYuy8z lSg/7fe+p2lvtc6qhFlxiQbf48Rkdser+VivvD8/V9tP6tzUuVfmnttjJ5zgePwMi397WWL3 u5XM9jxvN2jnaXU0Kn6zkhOTLVky0Wyi0O/DC9lKw9oZfkatrHv+z3PDb/4zxz5KPJp2QOn/ j9N/TMq0DGKMjyuxFGckGmoxFxUnAgBuNOpo/wEAAA== X-CMS-MailID: 20190621133551eucas1p210d2a66b8ee29eaf250fe63a053c9cb4 CMS-TYPE: 201P X-CMS-RootMailID: 20190621133551eucas1p210d2a66b8ee29eaf250fe63a053c9cb4 References: Cc: Stephen Warren , Bartlomiej Zolnierkiewicz , Gero Schumacher , Marek Szyprowski Subject: [U-Boot] [PATCH] ext4: add support for filesystems without JOURNAL X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" JOURNAL is optional for EXT4 (and EXT3) filesystems, so add support for skipping it. This fixes corrupting EXT4 volumes without JOURNAL after using uboot's 'ext4write' command. Signed-off-by: Marek Szyprowski Reviewed-by: Lukasz Majewski --- fs/ext4/ext4_journal.c | 4 ++++ fs/ext4/ext4_journal.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/fs/ext4/ext4_journal.c b/fs/ext4/ext4_journal.c index 6adbab93a68..3559daf11d2 100644 --- a/fs/ext4/ext4_journal.c +++ b/fs/ext4/ext4_journal.c @@ -645,6 +645,10 @@ void ext4fs_update_journal(void) struct ext_filesystem *fs = get_fs(); long int blknr; int i; + + if (!(fs->sb->feature_compatibility & EXT4_FEATURE_COMPAT_HAS_JOURNAL)) + return; + ext4fs_read_inode(ext4fs_root, EXT2_JOURNAL_INO, &inode_journal); blknr = read_allocated_block(&inode_journal, jrnl_blk_idx++, NULL); update_descriptor_block(blknr); diff --git a/fs/ext4/ext4_journal.h b/fs/ext4/ext4_journal.h index c9cf195f333..43fb8e76641 100644 --- a/fs/ext4/ext4_journal.h +++ b/fs/ext4/ext4_journal.h @@ -17,6 +17,8 @@ #ifndef __EXT4_JRNL__ #define __EXT4_JRNL__ +#define EXT4_FEATURE_COMPAT_HAS_JOURNAL 0x0004 + #define EXT2_JOURNAL_INO 8 /* Journal inode */ #define EXT2_JOURNAL_SUPERBLOCK 0 /* Journal Superblock number */