From: Yongpeng Yang <[email protected]>

f2fs_folio_wait_writeback ensures the folio write is submitted to the
block layer via __submit_merged_write_cond, then waits for the folio to
complete. Other I/O submissions are irrelevant to
f2fs_folio_wait_writeback. Thus, if the folio write bio is already
submitted, the function can return immediately.

Signed-off-by: Yongpeng Yang <[email protected]>
---
 fs/f2fs/data.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 12bf4b6e0075..c743352b686d 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -678,8 +678,12 @@ static void __submit_merged_write_cond(struct f2fs_sb_info 
*sbi,
                        ret = __has_merged_page(io->bio, inode, folio, ino);
                        f2fs_up_read(&io->io_rwsem);
                }
-               if (ret)
+               if (ret) {
                        __f2fs_submit_merged_write(sbi, type, temp);
+                       /* don't need to submit other types of bio. */
+                       if (folio)
+                               break;
+               }
 
                /* TODO: use HOT temp only for meta pages now. */
                if (type >= META)
-- 
2.43.0



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to