All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] fs: jffs2: improve one-pass reader and add metadata
@ 2026-11-03 16:49 Wagner Popov dos Santos
  2026-11-03 16:49 ` [PATCH 1/7] fs: jffs2: check cached-node reads before dereferencing Wagner Popov dos Santos
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Wagner Popov dos Santos @ 2026-11-03 16:49 UTC (permalink / raw)
  To: u-boot; +Cc: wpopov

This series improves the robustness of the JFFS2 one-pass reader and
introduces CONFIG_JFFS2_CACHE_TO_SPEED_UP, an optional directory
metadata cache designed to reduce repeated flash reads during sorting,
directory listing, and pathname lookup when loading files.

With the cache enabled, directory entry names are interned in a
configurable hash table during both full and summary-based filesystem
scans. Cached names, inode numbers, and parent inode numbers allow
lookup and sorting to use in-memory metadata. When fragment sorting
is enabled, listing can also identify successive versions of the same
directory entry through interned-name pointer equality before reading
the selected raw node.

The optimization trades additional RAM for fewer directory entry reads.
Names are allocated from 10 KiB pools, and
CONFIG_JFFS2_CACHE_NAMES_HASH_WIDTH controls the hash table size,
defaulting to 256 buckets. Cache memory is released with the filesystem
cache, and raw-node comparisons remain available when names are not
cached. Listing still reads selected directory entries and inode
information, and loading still reads file data.

The preceding fixes address unchecked node reads, missing inode
fragments, incomplete file loads incorrectly reported as successful,
unsafe symlink target handling, leaked dirents on comparison errors,
and incorrect handling of the selected raw dirent during listing.
These fixes apply independently of the new cache option.

The final patch corrects the sorting documentation to describe the
existing post-scan merge sort with O(n log n) comparisons. This series
does not introduce a new sorting algorithm; its performance focus is
reducing flash accesses through cached metadata.

Wagner Popov dos Santos (7):
  fs: jffs2: check cached-node reads before dereferencing
  fs: jffs2: reject missing fragments and fail incomplete loads
  fs: jffs2: resolve symlink targets safely
  fs: jffs2: release dirents on comparison read errors
  fs: jffs2: retain the selected raw dirent when listing
  fs: jffs2: cache directory metadata during one-pass scans
  fs: jffs2: document post-scan merge sort

 fs/jffs2/Kconfig         |  29 ++++-
 fs/jffs2/jffs2_1pass.c   | 261 +++++++++++++++++++++++++++++++++++++--
 fs/jffs2/jffs2_private.h |  30 +++++
 3 files changed, 308 insertions(+), 12 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-11-04  7:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03 16:49 [PATCH 0/7] fs: jffs2: improve one-pass reader and add metadata Wagner Popov dos Santos
2026-11-03 16:49 ` [PATCH 1/7] fs: jffs2: check cached-node reads before dereferencing Wagner Popov dos Santos
2026-11-03 16:49 ` [PATCH 2/7] fs: jffs2: reject missing fragments and fail incomplete loads Wagner Popov dos Santos
2026-11-03 16:49 ` [PATCH 3/7] fs: jffs2: resolve symlink targets safely Wagner Popov dos Santos
2026-11-03 16:49 ` [PATCH 4/7] fs: jffs2: release dirents on comparison read errors Wagner Popov dos Santos
2026-11-03 16:49 ` [PATCH 5/7] fs: jffs2: retain the selected raw dirent when listing Wagner Popov dos Santos
2026-11-03 16:49 ` [PATCH 6/7] fs: jffs2: cache directory metadata during one-pass scans Wagner Popov dos Santos
2026-11-03 17:05 ` [PATCH 7/7] fs: jffs2: document post-scan merge sort Wagner Popov dos Santos
2026-11-03 19:07 ` [PATCH 0/7] fs: jffs2: improve one-pass reader and add metadata Tom Rini
2026-11-04  7:47 ` Heiko Schocher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.