f2fs: fix to wait on block writeback for post_read case
authorChao Yu <chao@kernel.org>
Sun, 10 Dec 2023 11:35:43 +0000 (19:35 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 11 Dec 2023 22:04:08 +0000 (14:04 -0800)
commit55fdc1c24a1d6229fe0ecf31335fb9a2eceaaa00
treea95bad988cbf939152c5eb2a123b8defd3d01807
parent4961acdd65c956e97c1a000c82d91a8c1cdbe44b
f2fs: fix to wait on block writeback for post_read case

If inode is compressed, but not encrypted, it missed to call
f2fs_wait_on_block_writeback() to wait for GCed page writeback
in IPU write path.

Thread A GC-Thread
- f2fs_gc
 - do_garbage_collect
  - gc_data_segment
   - move_data_block
    - f2fs_submit_page_write
     migrate normal cluster's block via
     meta_inode's page cache
- f2fs_write_single_data_page
 - f2fs_do_write_data_page
  - f2fs_inplace_write_data
   - f2fs_submit_page_bio

IRQ
- f2fs_read_end_io
IRQ
old data overrides new data due to
out-of-order GC and common IO.
- f2fs_read_end_io

Fixes: 4c8ff7095bef ("f2fs: support data compression")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c