Skip to content

ext4: clean up ext4_ext_find_extent()

Theodore Ts'o linux-ext4 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10ext4: teach ext4_ext_find_extent() to free path on errorfs/ext4/ext4.h fs/ext4/extents.c fs/ext4/move_extent.c+21 -120 replies
2/10ext4: collapse ext4_convert_initialized_extents()fs/ext4/extents.c+57 -740 replies
3/10ext4: drop EXT4_EX_NOFREE_ON_ERR in convert_initialized_extent()fs/ext4/extents.c+5 -50 replies
4/10ext4: drop EXT4_EX_NOFREE_ON_ERR from rest of extents handling codefs/ext4/ext4.h fs/ext4/extents.c fs/ext4/migrate.c+60 -590 replies
5/10ext4: call ext4_ext_drop_refs() from ext4_ext_find_extent()fs/ext4/extents.c+4 -70 replies
6/10ext4: allow a NULL argument to ext4_ext_drop_refs()fs/ext4/extents.c fs/ext4/extents_status.c fs/ext4/migrate.c +1 more+29 -510 replies
7/10ext4: teach ext4_ext_find_extent() to realloc path if necessaryfs/ext4/ext4_extents.h fs/ext4/extents.c+10 -70 replies
8/10ext4: reuse path object in ext4_ext_shift_extents()fs/ext4/extents.c+5 -160 replies
9/10ext4: reuse path object in ext4_move_extents()fs/ext4/move_extent.c+12 -150 replies
10/10ext4: rename ext4_ext_find_extent() to ext4_find_extent()fs/ext4/ext4.h fs/ext4/extents.c fs/ext4/extents_status.c +2 more+27 -280 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/10] ext4: clean up ext4_ext_find_extent()

This patch set fixes a potential memory leak in the error path handling for ext4_fill_fiemap_extents(). More importantly, it makes the code clearer so that easier to understand and audit. The resulting code is also tighter, both in lines of codes and bytes of compiled object code. It also avoids some unnecessarily memory allocation and free operations.

Theodore Ts'o (10):
ext4: teach ext4_ext_find_extent() to free path on error
ext4: collapse ext4_convert_initialized_extents()
ext4: drop EXT4_EX_NOFREE_ON_ERR in convert_initialized_extent()
ext4: drop EXT4_EX_NOFREE_ON_ERR from rest of extents handling code
ext4: call ext4_ext_drop_refs() from ext4_ext_find_extent()
ext4: allow a NULL argument to ext4_ext_drop_refs()
ext4: teach ext4_ext_find_extent() to realloc path if necessary
ext4: reuse path object in ext4_ext_shift_extents()
ext4: reuse path object in ext4_move_extents()
ext4: rename ext4_ext_find_extent() to ext4_find_extent()

 fs/ext4/ext4.h           |  10 +-
 fs/ext4/ext4_extents.h   |   1 +
 fs/ext4/extents.c        | 360 +++++++++++++++++++++--------------------------
 fs/ext4/extents_status.c |   8 +-
 fs/ext4/migrate.c        |  11 +-
 fs/ext4/move_extent.c    |  43 +++---
 6 files changed, 194 insertions(+), 239 deletions(-)
Signature · 1 line
2.1.0