ext4: add support for filesystems without JOURNAL
A message that is not in the archive (sent off-list or not yet received): CGME20190621133551eucas1p210d2a66b8ee29eaf250fe63a053c9cb4@eucas1p2.samsung.com
PATCH 1/1 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.
--- fs/ext4/ext4_journal.c | 4 ++++ fs/ext4/ext4_journal.h | 2 ++ 2 files changed, 6 insertions(+)
fs/ext4/ext4_journal.c +4 -0
@@ -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);
fs/ext4/ext4_journal.h +2 -0
@@ -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 */
Signature · 1 line
2.17.1
PATCH 1/1 ext4: add support for filesystems without JOURNAL
Quoted 38 lines · On Fri, 21 Jun 2019 15:35:35 +0200 Marek Szyprowski <[email protected]>…
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 <[email protected]>--- fs/ext4/ext4_journal.c | 4 ++++ fs/ext4/ext4_journal.h | 2 ++ 2 files changed, 6 insertions(+)fs/ext4/ext4_journal.c +4
-0@@ -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);fs/ext4/ext4_journal.h +2
-0@@ -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
Quoted 1 line
Superblock number */
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190624/eb614aaf/attachment.sig>
PATCH 1/1 ext4: add support for filesystems without JOURNAL
In reply to Marek SzyprowskiQuoted 6 lines · Marek Szyprowski
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 <[email protected]>Reviewed-by Lukasz Majewski <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190718/89618a09/attachment.sig>