Commit 3fb778c3 authored by zhoumaowei's avatar zhoumaowei Committed by Todd Kjos
Browse files

FROMGIT: f2fs: fix to wait page writeback before setting gcing flag



Soft IRQ				Thread
- f2fs_write_end_io
					- f2fs_defragment_range
					 - set_page_private_gcing
 - type = WB_DATA_TYPE(page, false);
 : assign type w/ F2FS_WB_CP_DATA
 due to page_private_gcing() is true
  - dec_page_count() w/ wrong type
  - end_page_writeback()

Value of F2FS_WB_CP_DATA reference count may become negative under above
race condition, the root cause is we missed to wait page writeback before
setting gcing page private flag, let's fix it.

Fixes: 2d1fe8a8 ("f2fs: fix to tag gcing flag on page during file defragment")
Fixes: 4961acdd ("f2fs: fix to tag gcing flag on page during block migration")
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>

Bug: 353929868
(cherry picked from commit a4d7f2b3
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/

 dev)
Change-Id: I84a56ccf3308a6789ab979ed5a230a37b3594a66
Signed-off-by: default avatarzhoumaowei <zhoumaowei@oppo.com>
parent 63aeacfc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment