This patch count mmap write io more accurately.
Signed-off-by: Yunlei He <[email protected]>
---
fs/f2fs/file.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index f05209a62370..cb42d8464ad9 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -150,11 +150,13 @@ static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf)
}
set_page_dirty(page);
- f2fs_update_iostat(sbi, inode, APP_MAPPED_IO, F2FS_BLKSIZE);
- f2fs_update_time(sbi, REQ_TIME);
-
- trace_f2fs_vm_page_mkwrite(page, DATA);
out_sem:
+ if (!err) {
+ f2fs_update_iostat(sbi, inode, APP_MAPPED_IO, F2FS_BLKSIZE);
+ f2fs_update_time(sbi, REQ_TIME);
+
+ trace_f2fs_vm_page_mkwrite(page, DATA);
+ }
filemap_invalidate_unlock_shared(inode->i_mapping);
sb_end_pagefault(inode->i_sb);
--
2.40.1