From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Seongjae Jeong <jsjlee1020@gmail.com>,
stable@kernel.org, Chao Yu <chao@kernel.org>,
Jaegeuk Kim <jaegeuk@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.10.y 4/4] f2fs: fix submit accounting for IPU writeback
Date: Wed, 11 Nov 2026 10:41:13 -0500 [thread overview]
Message-ID: <20261111154005.2482659-4-sashal@kernel.org> (raw)
In-Reply-To: <20261111154005.2482659-1-sashal@kernel.org>
From: Seongjae Jeong <jsjlee1020@gmail.com>
[ Upstream commit 6d1f622b9c069378cdb83088be2b15a9b480b8a3 ]
f2fs_write_cache_pages() uses the submitted count, which is set to
fio.submitted in f2fs_write_single_data_page(), to update nwritten
and decrement wbc->nr_to_write.
In the OPU path, f2fs_submit_page_write() sets fio->submitted to 1.
However, in the IPU path, fio->submitted is never set and remains zero.
As a result, successful IPU writes are not accounted for.
This can cause asynchronous writeback to continue beyond its budget.
Set fio->submitted in f2fs_inplace_write_data() after a page is
successfully merged into a bio or submitted, so that successful
IPU writes are included in the writeback accounting.
Cc: stable@kernel.org
Fixes: d68f735b3bc9 ("f2fs: check io submission more precisely")
Signed-off-by: Seongjae Jeong <jsjlee1020@gmail.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
[ sashal: Adjusted context to preserve the older device-state and I/O-statistics calls. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/f2fs/segment.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index fec3b4a9e9542..4d759917c2849 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -3563,6 +3563,7 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio)
else
err = f2fs_submit_page_bio(fio);
if (!err) {
+ fio->submitted = 1;
update_device_state(fio);
f2fs_update_iostat(fio->sbi, fio->io_type, F2FS_BLKSIZE);
}
--
2.53.0
prev parent reply other threads:[~2026-11-11 15:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-07 11:25 FAILED: patch "[PATCH] f2fs: fix submit accounting for IPU writeback" failed to apply to 5.10-stable tree Sasha Levin
2026-11-11 15:41 ` [PATCH 5.10.y 1/4] f2fs: rename logical_to_blk and blk_to_logical Sasha Levin
2026-11-11 15:41 ` [PATCH 5.10.y 2/4] f2fs: use new conversion functions between blks and bytes Sasha Levin
2026-11-11 15:41 ` [PATCH 5.10.y 3/4] f2fs: remove allow_outplace_dio() Sasha Levin
2026-11-11 15:41 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261111154005.2482659-4-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=jsjlee1020@gmail.com \
--cc=stable@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox