]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: don't BUG on inconsistent journal feature
authorJan Kara <jack@suse.cz>
Fri, 10 Jul 2020 14:07:59 +0000 (16:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:22:29 +0000 (11:22 +0200)
commit60e2824ab30a19c7aaf5a3932bc155d18b2cd816
treef204e49ad91378ee4dd005be74a10501dfe3e6f4
parent0360bad698522141fdeee3c349f840eff802831f
ext4: don't BUG on inconsistent journal feature

[ Upstream commit 11215630aada28307ba555a43138db6ac54fa825 ]

A customer has reported a BUG_ON in ext4_clear_journal_err() hitting
during an LTP testing. Either this has been caused by a test setup
issue where the filesystem was being overwritten while LTP was mounting
it or the journal replay has overwritten the superblock with invalid
data. In either case it is preferable we don't take the machine down
with a BUG_ON. So handle the situation of unexpectedly missing
has_journal feature more gracefully. We issue warning and fail the mount
in the cases where the race window is narrow and the failed check is
most likely a programming error. In cases where fs corruption is more
likely, we do full ext4_error() handling before failing mount / remount.

Reviewed-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20200710140759.18031-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/super.c