summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJack Qiu <jack.qiu@huawei.com>2020-08-31 09:58:02 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2020-09-11 11:11:24 -0700
commit335cac8b25fd4601160080d2c012154c2f3b8676 (patch)
treebee292ab2c9ec10d0fd796153a65a8eab2c43fb7 /fs
parent4cb03fecd3ff9adfaeb68267aac760eaaac0d7e1 (diff)
f2fs: correct statistic of APP_DIRECT_IO/APP_DIRECT_READ_IO
Miss to update APP_DIRECT_IO/APP_DIRECT_READ_IO when receiving async DIO. For example: fio -filename=/data/test.0 -bs=1m -ioengine=libaio -direct=1 -name=fill -size=10m -numjobs=1 -iodepth=32 -rw=write Signed-off-by: Jack Qiu <jack.qiu@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/data.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 6a20f2e664c4..a490e1b21930 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3673,12 +3673,18 @@ static ssize_t f2fs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
err);
if (!do_opu)
set_inode_flag(inode, FI_UPDATE_WRITE);
+ } else if (err == -EIOCBQUEUED) {
+ f2fs_update_iostat(F2FS_I_SB(inode), APP_DIRECT_IO,
+ count - iov_iter_count(iter));
} else if (err < 0) {
f2fs_write_failed(mapping, offset + count);
}
} else {
if (err > 0)
f2fs_update_iostat(sbi, APP_DIRECT_READ_IO, err);
+ else if (err == -EIOCBQUEUED)
+ f2fs_update_iostat(F2FS_I_SB(inode), APP_DIRECT_READ_IO,
+ count - iov_iter_count(iter));
}
out: