[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <cover.1768844021.git.ojaswin@linux.ibm.com>
Date: Mon, 19 Jan 2026 23:12:56 +0530
From: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To: linux-ext4@...r.kernel.org, "Theodore Ts'o" <tytso@....edu>
Cc: Ritesh Harjani <ritesh.list@...il.com>, Zhang Yi <yi.zhang@...wei.com>,
Jan Kara <jack@...e.cz>, libaokun1@...wei.com,
linux-kernel@...r.kernel.org
Subject: [PATCH v3 0/8] ext4 extent split/convert refactor and kunit tests
Hi everyone,
thanks for the reviews, the patches are now looking in a good shap
I see no new regressions in 4k, 64k and nodioread_nolock for -g auto
group.
@Ted, I see you have tentatively picked v2 in dev branch for your
testing, so I've rebased this one over commit 1aaa8643dca3 in the dev
branch. Hope it applied smoothly :)
Changes in v3:
- Use EX_DATA_LBLK/LEN instead of hard-coding in extents-test.c
- RVBs of Jan and Yi (Thanks!)
- Patch 6/8 - update orig_* after first split
- Minor fixes
Changes in v2:
** KUnit **
- Added new patch 3 to add support for tracking extent status cache in
kunit tests
- Kunit tests in patch 2 now test ext4_map_create_blocks() since the
final es cachine is done here.
- Also refactored the patch 2 to avoid duplicate code.
** extent handling code **
- Fixed some issues detected by extent status Kunit tests where we were
going out of sync when zeroout fallback was taken.
- We no longer handle unwrit to unwrit split as there are no users of
that anymore
- Made sure to propogate flags to ext4_find_extent() as well in patch 4,5.
Also remove some duplication of flags.
- Cleaned up the code flow of ext4_split_extent() in patch 6.
- Picked up RVBs by Jan.
v1: https://lore.kernel.org/linux-ext4/cover.1767528171.git.ojaswin@linux.ibm.com/T/#t
** Testing **
- Run xfstests for 4k, 64k and nodioread_nolock for -g auto with no new
regressions.
- All new kunit tests in patch 1-3 that were failing due to issues are now
passing with the patches
** Original Cover **
Offlate we've have seen multiple issues and inconsistencies in the
our extent splitting and conversion logic causing subtle bugs. Recent
patches by Yhang Zi [1] helped address some of the issues however
the messy use of EXT4_EXT_DATA_VALID* and EXT4_EXT_MARK_UNWRIT* flags
made the implementation confusing and error prone.
This patchset aims to refactor the explent split and convert code paths
to make the code simpler and the behavior consistent and easy to
understand. It also adds several Kunit tests to stress various
permutations of extent splitting and conversion.
I've rebased this over [2] since it seems like it'll go in first.
Another idea I want to try out after this is proactively zeroout
before even trying to split, as Jan suggested here [3], but before
trying to do that I wanted to refactor and add some tests hence sending
these patches out first.
[1] https://lore.kernel.org/linux-ext4/20251129103247.686136-1-yi.zhang@huaweicloud.com/
[2] https://lore.kernel.org/linux-ext4/20251223011802.31238-1-yi.zhang@huaweicloud.com/T/#t
[3] https://lore.kernel.org/linux-ext4/yro4hwpttmy6e2zspvwjfdbpej6qvhlqjvlr5kp3nwffqgcnfd@z6qual55zhfq/
Rest of the details can be found in the commit messages.
Patch 1-2: new kunit tests
Patch 3-4: minor fixes
Patch 5: refactoring zeroout and making sure zeroout handles all
permutations correctly
Patch 6: Refactoring ext4_split_* functions.
Patch 7: Enable zeroout for writ to unwrit case
*****
Ojaswin Mujoo (8):
ext4: kunit tests for extent splitting and conversion
ext4: kunit tests for higher level extent manipulation functions
ext4: Add extent status cache support to kunit tests
ext4: propagate flags to convert_initialized_extent()
ext4: propagate flags to ext4_convert_unwritten_extents_endio()
ext4: Refactor zeroout path and handle all cases
ext4: Refactor split and convert extents
ext4: Allow zeroout when doing written to unwritten split
fs/ext4/ext4.h | 4 +
fs/ext4/extents-test.c | 1025 ++++++++++++++++++++++++++++++++++++++
fs/ext4/extents.c | 568 +++++++++++----------
fs/ext4/extents_status.c | 1 +
fs/ext4/inode.c | 12 +-
5 files changed, 1355 insertions(+), 255 deletions(-)
create mode 100644 fs/ext4/extents-test.c
--
2.52.0
Powered by blists - more mailing lists