ext4: correctly restore system zone info when remount fails
authorJan Kara <jack@suse.cz>
Tue, 28 Jul 2020 13:04:37 +0000 (15:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:31 +0000 (11:29 +0200)
commite3e46eaa2f33b9e2d8906a9c52be02b48774de55
tree0304451be20c9e39e72e4797186dfc851cda91e7
parent6c30edde8a3a710c20b5689a921425a479501cb5
ext4: correctly restore system zone info when remount fails

[ Upstream commit 0f5bde1db174f6c471f0bd27198575719dabe3e5 ]

When remounting filesystem fails late during remount handling and
block_validity mount option is also changed during the remount, we fail
to restore system zone information to a state matching the mount option.
This is mostly harmless, just the block validity checking will not match
the situation described by the mount option. Make sure these two are always
consistent.

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