From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 568622DC767 for ; Tue, 6 Jan 2026 09:35:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767692111; cv=none; b=QFEPNvviP6BwpNTkk+dXG8M0lN1qahPzBsIZFNYTk6rlhoD8zDxO7Myz/cxWCGzvLHQzPEOT6dh3eovOXVpubn0JfFZ52PpWhW+7LAD/RXyqE+sNnAJZ5wJl5mQWo8bTM06TC1aBiQIlPOnQYwWkWSqEZm4f6T8jtWYPySAX2Xg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767692111; c=relaxed/simple; bh=XIq6M4UbEmrOWTHwxdcXNVwcnnNutZI50868xEC0uYk=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=BDjMQgsjeC3t25tVGla0n6eZAn6Sv/EXL0WA/QvKzOEx6Zq59WB5O0gv09FizDERtDbf2iYCOSWPp7J3ARRSUb8CV236awK9YXCKdaMRB4VkYZnrtPNgJzI1ThjhZpZXPOKUu53FKO0P1ILaCxa0l+sLPMqU7jvbzyLBh2mfsqM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cUySUx98; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cUySUx98" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5C86C116C6; Tue, 6 Jan 2026 09:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767692110; bh=XIq6M4UbEmrOWTHwxdcXNVwcnnNutZI50868xEC0uYk=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=cUySUx98FYbcUlvaRZbyOCiF4ajM47DWtdBmrtS5xj68olE+Y/2sA7tZjmpRBpqGP Z3yDRj6ZURpVtruGvJCQuN8EqF1qreZMcVas7IDnNa1cM0NlocDoeodj0F2D7StN1B R5YKXhJxIC1/lxuBREEecwgWEVb7T0UaR1njchD84gDia0Ypcu2SWKt55IhaN/85Y9 2htXyXh3JKVc4fdRueO3ZA9ih8zb2mB9incN0mUTiMctNPeSbacxPYeeZ9pLIPqpKu 4PP+lNv9I/CSCgpBDoH59HqvvJYBi5b73HzjQJ21atjOQewp9wFpBj9YttIVusgLXE U4i1otCUrbpJg== Message-ID: <5af27303-8347-4518-acc3-8d36cf14280d@kernel.org> Date: Tue, 6 Jan 2026 17:35:16 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 5/5] f2fs: advance index and offset after zeroing in large folio read To: Nanzhe Zhao , Kim Jaegeuk References: <20260105153101.152892-1-nzzhao@126.com> <20260105153101.152892-6-nzzhao@126.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20260105153101.152892-6-nzzhao@126.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > --- > 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 >