]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
e2fsck: save EXT2_ERROR_FS flag during journal replay
authorBaokun Li <libaokun1@huawei.com>
Fri, 17 Feb 2023 10:09:21 +0000 (18:09 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 1 Dec 2023 17:35:33 +0000 (12:35 -0500)
commit6ab579ee3c6c8c2d76aebcc9e8430a797c9963ff
tree06f6a08776c51534866cb80b42d127d1eb6545a9
parent795dcc264f48098ca5b214bba7d1b94189b2e491
e2fsck: save EXT2_ERROR_FS flag during journal replay

When repairing a file system with s_errno missing from the journal
superblock but the file system superblock contains the ERROR_FS flag,
the ERROR_FS flag on the file system image is overwritten after the
journal replay, followed by a reload of the file system data from disk
and the ERROR_FS flag in memory is overwritten. Also s_errno is not set
and the ERROR_FS flag is not reset. Therefore, when checked later, no
forced check is performed, which makes it possible to have some errors
hidden in the disk image, which may make it read-only when using the
file system. So we save the ERROR_FS flag to the superblock after the
journal replay, instead of just relying on the jsb->s_errno to do this.

Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: zhanchengbin <zhanchengbin1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20230217100922.588961-2-libaokun1@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/journal.c