fs: ext4: do not write on filesystem with metadata_csum feature
authorSébastien Szymanski <sebastien.szymanski@armadeus.com>
Fri, 22 Mar 2019 08:33:52 +0000 (09:33 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 22 Mar 2019 16:15:24 +0000 (12:15 -0400)
commit2e7365518acdb8fb6e9be332c8a6c57b457188d9
tree5951f299b8b05cb6011deb8522a8b883a5d260e2
parent50580a0e7053599abdaa467cb43cff0c66564369
fs: ext4: do not write on filesystem with metadata_csum feature

U-Boot doesn't support metadata_csum feature. Writing to filesystem with
metadata_csum feature makes the filesystem corrupted and unbootable by
Linux:

[    2.527495] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 0 failed (52188!=0)
[    2.537421] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 1 failed (5262!=0)
...
[    2.653308] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 14 failed (42611!=0)
[    2.662179] EXT4-fs (mmcblk0p2): ext4_check_descriptors: Checksum for group 15 failed (21527!=0)
[    2.687920] JBD2: journal checksum error
[    2.691982] EXT4-fs (mmcblk0p2): error loading journal
[    2.698292] VFS: Cannot open root device "mmcblk0p2" or unknown-block(179,2): error -74

Don't write to filesystem with meatadata_csum feature to not corrupt the
filesystem.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
fs/ext4/ext4_write.c
include/ext4fs.h