All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v1 0/5] f2fs: fix large folio read corner cases for immutable files
@ 2026-01-05 15:30 ` Nanzhe Zhao
  0 siblings, 0 replies; 42+ messages in thread
From: Nanzhe Zhao @ 2026-01-05 15:30 UTC (permalink / raw)
  To: Kim Jaegeuk; +Cc: Nanzhe Zhao, linux-kernel, linux-f2fs-devel

When reading immutable, non-compressed files with large folios enabled,
I was able to reproduce readahead hangs while reading sparse files with
holes and heavily fragmented files. The problems were caused by a few
corner cases in the large-folio read loop:

  - f2fs_folio_state could be observed with uninitialized field
    read_pages_pending
  - subpage accounting could become inconsistent with BIO completion,
    leading to folios being prematurely unlocked/marked uptodate.
  - NULL_ADDR/NEW_ADDR blocks can carry F2FS_MAP_MAPPED, causing the
    large-folio read path to treat hole blocks as mapped and to account
    them in read_pages_pending.
  - in readahead, a folio that never had any subpage queued to a BIO
    would not be seen by f2fs_finish_read_bio(), leaving it locked.
  - the zeroing path did not advance index/offset before continuing.

This patch series fixes the above issues in f2fs_read_data_large_folio()
introduced by commit 05e65c14ea59 ("f2fs: support large folio for
immutable non-compressed case").

Testing
-------

All patches pass scripts/checkpatch.pl.

I tested the basic large-folio immutable read case described in the
original thread (create a large file, set immutable, drop caches to
reload the inode, then read it), and additionally verified:

  - sparse file
  - heavily fragmented file

In all cases, reads completed without hangs and data was verified against
the expected contents.

Nanzhe Zhao (5):
  f2fs: Zero f2fs_folio_state on allocation
  f2fs: Accounting large folio subpages before bio submission
  f2fs: add f2fs_block_needs_zeroing() to handle hole blocks
  f2fs: add 'folio_in_bio' to handle readahead folios with no BIO
    submission
  f2fs: advance index and offset after zeroing in large folio read

 fs/f2fs/data.c | 54 +++++++++++++++++++++++++++++++++-----------------
 1 file changed, 36 insertions(+), 18 deletions(-)


base-commit: 48b5439e04ddf4508ecaf588219012dc81d947c0
--
2.34.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

end of thread, other threads:[~2026-01-08 22:36 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05 15:30 [f2fs-dev] [PATCH v1 0/5] f2fs: fix large folio read corner cases for immutable files Nanzhe Zhao
2026-01-05 15:30 ` Nanzhe Zhao
2026-01-05 15:30 ` [f2fs-dev] [PATCH v1 1/5] f2fs: Zero f2fs_folio_state on allocation Nanzhe Zhao
2026-01-05 15:30   ` Nanzhe Zhao
2026-01-06  3:38   ` [f2fs-dev] " Barry Song
2026-01-06  3:38     ` Barry Song
2026-01-07  3:44     ` [f2fs-dev] " Nanzhe Zhao
2026-01-07  3:44       ` Nanzhe Zhao
2026-01-08 22:35       ` [f2fs-dev] " Barry Song
2026-01-08 22:35         ` Barry Song
2026-01-06  9:16   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-01-06  9:16     ` Chao Yu
2026-01-05 15:30 ` [f2fs-dev] [PATCH v1 2/5] f2fs: Accounting large folio subpages before bio submission Nanzhe Zhao
2026-01-05 15:30   ` Nanzhe Zhao
2026-01-06  9:16   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-01-06  9:16     ` Chao Yu
2026-01-05 15:30 ` [f2fs-dev] [PATCH v1 3/5] f2fs: add f2fs_block_needs_zeroing() to handle hole blocks Nanzhe Zhao
2026-01-05 15:30   ` Nanzhe Zhao
2026-01-06  9:19   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-01-06  9:19     ` Chao Yu
2026-01-06 11:25     ` [f2fs-dev] " Nanzhe Zhao
2026-01-06 11:25       ` Nanzhe Zhao
2026-01-06  9:30   ` [f2fs-dev] " kernel test robot
2026-01-06  9:30     ` kernel test robot
2026-01-05 15:31 ` [f2fs-dev] [PATCH v1 4/5] f2fs: add 'folio_in_bio' to handle readahead folios with no BIO submission Nanzhe Zhao
2026-01-05 15:31   ` Nanzhe Zhao
2026-01-06  9:31   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-01-06  9:31     ` Chao Yu
2026-01-07  0:33     ` [f2fs-dev] " Nanzhe Zhao
2026-01-07  0:33       ` Nanzhe Zhao
2026-01-07  1:16       ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-01-07  1:16         ` Chao Yu
2026-01-05 15:31 ` [f2fs-dev] [PATCH v1 5/5] f2fs: advance index and offset after zeroing in large folio read Nanzhe Zhao
2026-01-05 15:31   ` Nanzhe Zhao
2026-01-06  9:35   ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-01-06  9:35     ` Chao Yu
2026-01-07  3:08 ` [f2fs-dev] [PATCH v1 0/5] f2fs: fix large folio read corner cases for immutable files Jaegeuk Kim via Linux-f2fs-devel
2026-01-07  3:08   ` Jaegeuk Kim
2026-01-08  2:17   ` [f2fs-dev] " Nanzhe Zhao
2026-01-08  2:17     ` Nanzhe Zhao
2026-01-08  9:23     ` [f2fs-dev] " Chao Yu via Linux-f2fs-devel
2026-01-08  9:23       ` Chao Yu

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.