Commit bd8fbd8a authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Tom Rini
Browse files

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: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Lukasz Majewski's avatarLukasz Majewski <lukma@denx.de>
parent 1c9f8f64
...@@ -645,6 +645,10 @@ void ext4fs_update_journal(void) ...@@ -645,6 +645,10 @@ void ext4fs_update_journal(void)
struct ext_filesystem *fs = get_fs(); struct ext_filesystem *fs = get_fs();
long int blknr; long int blknr;
int i; int i;
if (!(fs->sb->feature_compatibility & EXT4_FEATURE_COMPAT_HAS_JOURNAL))
return;
ext4fs_read_inode(ext4fs_root, EXT2_JOURNAL_INO, &inode_journal); ext4fs_read_inode(ext4fs_root, EXT2_JOURNAL_INO, &inode_journal);
blknr = read_allocated_block(&inode_journal, jrnl_blk_idx++, NULL); blknr = read_allocated_block(&inode_journal, jrnl_blk_idx++, NULL);
update_descriptor_block(blknr); update_descriptor_block(blknr);
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
#ifndef __EXT4_JRNL__ #ifndef __EXT4_JRNL__
#define __EXT4_JRNL__ #define __EXT4_JRNL__
#define EXT4_FEATURE_COMPAT_HAS_JOURNAL 0x0004
#define EXT2_JOURNAL_INO 8 /* Journal inode */ #define EXT2_JOURNAL_INO 8 /* Journal inode */
#define EXT2_JOURNAL_SUPERBLOCK 0 /* Journal Superblock number */ #define EXT2_JOURNAL_SUPERBLOCK 0 /* Journal Superblock number */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment