mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] ocfs2: consolidate extent list validation into block read callbacks
@ 2026-04-03  9:07 Joseph Qi
  2026-04-03  9:08 ` [PATCH 1/4] ocfs2: validate dx_root extent list fields during block read Joseph Qi
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Joseph Qi @ 2026-04-03  9:07 UTC (permalink / raw)
  To: Andrew Morton, Heming Zhao, ZhengYuan Huang; +Cc: ocfs2-devel, linux-kernel

ocfs2 validates extent list fields (l_count, l_next_free_rec) at various
points during extent tree traversal. This is fragile because each caller
must remember to check for corrupted on-disk data before using it.

This series moves those checks into the block read validation callbacks
(ocfs2_validate_dx_root and ocfs2_validate_extent_block), so corrupted
fields are caught early at block read time. Redundant post-read checks
are then removed.

Patch 1-2 handle the dx_root extent list:
  - Move l_count and l_next_free_rec validation into
    ocfs2_validate_dx_root(), skipping inline dx roots.
  - Remove the now-redundant l_next_free_rec == 0 check in
    ocfs2_dx_dir_lookup_rec() and rework the error message to avoid a
    potential NULL pointer dereference of rec.

Patch 3-4 handle extent blocks:
  - Add l_count and l_next_free_rec validation to
    ocfs2_validate_extent_block().
  - Remove the duplicate l_next_free_rec > l_count check in
    __ocfs2_find_path().

Joseph Qi (4):
  ocfs2: validate dx_root extent list fields during block read
  ocfs2: remove empty extent list check in ocfs2_dx_dir_lookup_rec()
  ocfs2: validate extent block list fields during block read
  ocfs2: remove redundant l_next_free_rec check in __ocfs2_find_path()

 fs/ocfs2/alloc.c | 35 +++++++++++++++++++++-------------
 fs/ocfs2/dir.c   | 49 +++++++++++++++++++++++++++---------------------
 2 files changed, 50 insertions(+), 34 deletions(-)

-- 
2.39.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-04-07 15:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-03  9:07 [PATCH 0/4] ocfs2: consolidate extent list validation into block read callbacks Joseph Qi
2026-04-03  9:08 ` [PATCH 1/4] ocfs2: validate dx_root extent list fields during block read Joseph Qi
2026-04-07 14:58   ` Heming Zhao
2026-04-03  9:08 ` [PATCH 2/4] ocfs2: remove empty extent list check in ocfs2_dx_dir_lookup_rec() Joseph Qi
2026-04-07 14:59   ` Heming Zhao
2026-04-03  9:08 ` [PATCH 3/4] ocfs2: validate extent block list fields during block read Joseph Qi
2026-04-07 15:00   ` Heming Zhao
2026-04-03  9:08 ` [PATCH 4/4] ocfs2: remove redundant l_next_free_rec check in __ocfs2_find_path() Joseph Qi
2026-04-07 15:01   ` Heming Zhao
2026-04-03 19:27 ` [PATCH 0/4] ocfs2: consolidate extent list validation into block read callbacks Andrew Morton
2026-04-07  1:44   ` Joseph Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®