This is a note to let you know that I've just added the patch titled f2fs: fix iostat parameter for discard to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: f2fs-fix-iostat-parameter-for-discard.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit c6b92773fc76ae4b165c90efcce007f43b00fec8 Author: Yangtao Li <frank.li@xxxxxxxx> Date: Mon Dec 5 22:56:03 2022 +0800 f2fs: fix iostat parameter for discard [ Upstream commit 15e38ee44d50cad264da80ef75626b9224ddc4a3 ] Just like other data we count uses the number of bytes as the basic unit, but discard uses the number of cmds as the statistical unit. In fact the discard command contains the number of blocks, so let's change to the number of bytes as the base unit. Fixes: b0af6d491a6b ("f2fs: add app/fs io stat") Signed-off-by: Yangtao Li <frank.li@xxxxxxxx> Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index c568821b8463..c1d0713666ee 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1170,7 +1170,7 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi, atomic_inc(&dcc->issued_discard); - f2fs_update_iostat(sbi, NULL, FS_DISCARD, 1); + f2fs_update_iostat(sbi, NULL, FS_DISCARD, len * F2FS_BLKSIZE); lstart += len; start += len;