]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ext4: prevent partial update of the extent blocks
authorZhang Yi <yi.zhang@huawei.com>
Wed, 8 Sep 2021 12:08:50 +0000 (20:08 +0800)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:49:41 +0000 (09:49 +0100)
commit720f9616ce420c93318a6e19928900cd6e156bea
tree0608b9816f02edd6f8512ab25303ca95b2282935
parent146834d0b688a8e5f1642418fd86fc280087ca94
ext4: prevent partial update of the extent blocks

BugLink: https://bugs.launchpad.net/bugs/1956305
commit 0f2f87d51aebcf71a709b52f661d681594c7dffa upstream.

In the most error path of current extents updating operations are not
roll back partial updates properly when some bad things happens(.e.g in
ext4_ext_insert_extent()). So we may get an inconsistent extents tree
if journal has been aborted due to IO error, which may probability lead
to BUGON later when we accessing these extent entries in errors=continue
mode. This patch drop extent buffer's verify flag before updatng the
contents in ext4_ext_get_access(), and reset it after updating in
__ext4_ext_dirty(). After this patch we could force to check the extent
buffer if extents tree updating was break off, make sure the extents are
consistent.

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20210908120850.4012324-4-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
fs/ext4/extents.c