mbox series

[0/9] ext4: fix stale extent status entries and clairfy rules

Message ID 20250423085257.122685-1-yi.zhang@huaweicloud.com
Headers show
Series ext4: fix stale extent status entries and clairfy rules | expand

Message

Zhang Yi April 23, 2025, 8:52 a.m. UTC
This patch series addresses the potential problems discussed with Jan
Kara regarding the modification rules for mapping extents[1]. Preparing
for the buffered I/O conversion for regular files.

This change includes:

Patch 1-5 fixes problems related to stale extent status entries that
may arise during the collapsing of ranges, the insertion of ranges, or
file truncation when these operations compete with concurrent writeback,
fiemap, or get extent cache.

Patch 6-8 adds a helper function to verify whether the context for
modifying extents is safe when EXT4_DEBUG is enabled. It primarily
checks the inode's i_rwsem and the mapping's invalidate_lock.

Patch 9 adds a comment to clarify the rules for loading, mapping,
modifying, and removing extents.

Please refer to the following patches for details.

[1] https://lore.kernel.org/linux-ext4/20241211160047.qnxvodmbzngo3jtr@quack3/

Thanks,
Yi.

Zhang Yi (9):
  ext4: ext4: unify EXT4_EX_NOCACHE|NOFAIL flags in
    ext4_ext_remove_space()
  ext4: generalize EXT4_GET_BLOCKS_IO_SUBMIT flag usage
  ext4: prevent stale extent cache entries caused by concurrent I/O
    writeback
  ext4: prevent stale extent cache entries caused by concurrent fiemap
  ext4: prevent stale extent cache entries caused by concurrent get
    es_cache
  ext4: factor out is_special_ino()
  ext4: introduce ext4_check_map_extents_env() debug helper
  ext4: check env when mapping and modifying extents
  ext4: clairfy the rules for modifying extents

 fs/ext4/ext4.h           | 26 ++++++++++++---
 fs/ext4/extents.c        | 54 ++++++++++++++++++++----------
 fs/ext4/extents_status.c | 35 ++++++++++++++++++--
 fs/ext4/fast_commit.c    |  4 ++-
 fs/ext4/inode.c          | 71 +++++++++++++++++++++++++++++++---------
 fs/ext4/ioctl.c          |  8 ++++-
 6 files changed, 157 insertions(+), 41 deletions(-)

Comments

Theodore Ts'o May 20, 2025, 2:40 p.m. UTC | #1
On Wed, 23 Apr 2025 16:52:48 +0800, Zhang Yi wrote:
> This patch series addresses the potential problems discussed with Jan
> Kara regarding the modification rules for mapping extents[1]. Preparing
> for the buffered I/O conversion for regular files.
> 
> This change includes:
> 
> Patch 1-5 fixes problems related to stale extent status entries that
> may arise during the collapsing of ranges, the insertion of ranges, or
> file truncation when these operations compete with concurrent writeback,
> fiemap, or get extent cache.
> 
> [...]

Applied, thanks!

[1/9] ext4: ext4: unify EXT4_EX_NOCACHE|NOFAIL flags in ext4_ext_remove_space()
      commit: 53ce42accd2002cc490fc86000ac532530507a74
[2/9] ext4: generalize EXT4_GET_BLOCKS_IO_SUBMIT flag usage
      commit: 86b349ce0312a397a6961e457108556e44a3d211
[3/9] ext4: prevent stale extent cache entries caused by concurrent I/O writeback
      commit: 402e38e6b71f5739119ca3107f375e112d63c7c5
[4/9] ext4: prevent stale extent cache entries caused by concurrent fiemap
      commit: 151ff9325e5e17c97839a00b740726656b04647b
[5/9] ext4: prevent stale extent cache entries caused by concurrent get es_cache
      commit: f22a0ef2231a7d8374bb021eb86404d0e9de5a02
[6/9] ext4: factor out is_special_ino()
      commit: 0b8e0bd45007d5740391e658c2581bd614207387
[7/9] ext4: introduce ext4_check_map_extents_env() debug helper
      commit: 7871da20d484d5c7e536bfd52845b6be4488ff30
[8/9] ext4: check env when mapping and modifying extents
      commit: 1b4d2a0b794669e54914e3f429c08e49ea40b40c
[9/9] ext4: clairfy the rules for modifying extents
      commit: 24b7a2331fcdf6de103ea85e67eede43c0372f77

Best regards,