diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2019-06-21 15:35:35 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-07-18 11:31:24 -0400 |
commit | bd8fbd8a13b8a696aed312753f46432b19b61fd6 (patch) | |
tree | e38b25bdf3e3e3fe4898beb658e421f9d69ee6b7 /fs/ext4/ext4_journal.c | |
parent | 1c9f8f6412de4447c4f6fadeac1919c89de005f7 (diff) | |
download | u-boot-bd8fbd8a13b8a696aed312753f46432b19b61fd6.tar.gz |
ext4: add support for filesystems without JOURNAL
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 <m.szyprowski@samsung.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'fs/ext4/ext4_journal.c')
-rw-r--r-- | fs/ext4/ext4_journal.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ext4/ext4_journal.c b/fs/ext4/ext4_journal.c index 6adbab93a6..3559daf11d 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); |