[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5af27303-8347-4518-acc3-8d36cf14280d@kernel.org>
Date: Tue, 6 Jan 2026 17:35:16 +0800
From: Chao Yu <chao@...nel.org>
To: Nanzhe Zhao <nzzhao@....com>, Kim Jaegeuk <jaegeuk@...nel.org>
Cc: chao@...nel.org, linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 5/5] f2fs: advance index and offset after zeroing in
large folio read
On 1/5/2026 11:31 PM, Nanzhe Zhao wrote:
> In f2fs_read_data_large_folio(), the block zeroing path calls
> folio_zero_range() and then continues the loop. However, it fails to
> advance index and offset before continuing.
>
> This can cause the loop to repeatedly process the same subpage of the
> folio, leading to stalls/hangs and incorrect progress when reading large
> folios with holes/zeroed blocks.
>
> Fix it by incrementing index and offset in the zeroing path before
> continuing.
>
> Signed-off-by: Nanzhe Zhao <nzzhao@....com>
> ---
> fs/f2fs/data.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index ac569a396914..07c222bcc5e0 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -2446,7 +2446,7 @@ static int f2fs_read_data_large_folio(struct inode *inode,
> if (!folio)
> goto out;
>
> - folio_in_bio = false
> + folio_in_bio = false;
Should be fixed in 4/5.
> index = folio->index;
> offset = 0;
> ffs = NULL;
> @@ -2483,6 +2483,8 @@ static int f2fs_read_data_large_folio(struct inode *inode,
> ret = -EIO;
> goto err_out;
> }
> + index++;
> + offset++;
What about increasing index & offset in for () statement, in case we missed
to update them anywhere.
Thanks,
> continue;
> } else if((map.m_flags & F2FS_MAP_MAPPED)) {
> block_nr = map.m_pblk + index - map.m_lblk;
> --
> 2.34.1
>
Powered by blists - more mailing lists