[PATCH v3 0/8] ext4: fix WARNING in ext4_da_update_reserve_space

From: Baokun Li
Date: Wed Apr 12 2023 - 08:42:19 EST


V1->V2:
Modify the patch 1 description and add the Fixes tag.
Add the patch 2 as suggested by Jan Kara.
V2->V3:
Remove the redundant judgment of count in Patch [1].
Rename ext4_es_alloc_should_nofail to ext4_es_must_keep.
Split Patch [2].
Make some functions return void to simplify the code.

This patch set consists of three parts:
1. Patch [1] fix WARNING in ext4_da_update_reserve_space.
2. Patch [2][3] fix extent tree inconsistencies that may be caused
by memory allocation failures.
3. Patch [4]-[8] is cleanup.

Baokun Li (8):
ext4: only update i_reserved_data_blocks on successful block
allocation
ext4: add a new helper to check if es must be kept
ext4: use __GFP_NOFAIL if allocating extents_status cannot fail
ext4: make __es_remove_extent return void
ext4: make ext4_es_remove_extent return void
ext4: make ext4_es_insert_delayed_block return void
ext4: make ext4_es_insert_extent return void
ext4: make ext4_zeroout_es return void

fs/ext4/extents.c | 49 ++++-----------
fs/ext4/extents_status.c | 127 +++++++++++++++++----------------------
fs/ext4/extents_status.h | 14 ++---
fs/ext4/indirect.c | 8 +++
fs/ext4/inline.c | 12 +---
fs/ext4/inode.c | 46 +++-----------
6 files changed, 96 insertions(+), 160 deletions(-)

--
2.31.1