Re: [f2fs-dev] [PATCH] f2fs: fix potential deadlock in gc_merge path of f2fs_balance_fs()

From: patchwork-bot+f2fs

Date: Fri May 22 2026 - 00:33:52 EST


Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@xxxxxxxxxx>:

On Tue, 19 May 2026 01:14:38 +0000 you wrote:
> When we mount device w/ gc_merge mount option, we may suffer below
> potential deadlock:
>
> Kworker GC trehad Truncator
> - f2fs_write_cache_pages
> - f2fs_write_single_data_page
> - f2fs_do_write_data_page
> - folio_start_writeback --- set writeback flag on folio
> - f2fs_outplace_write_data
> : cached folio in internal bio cache
> - f2fs_balance_fs
> - wake_up(gc_thread)
> : wake up gc thread to run foreground GC
> - finish_wait(fggc_wq)
> : wait on the waitqueue --- wait on GC thread to finish the work
> - truncate_inode_pages_range
> - __filemap_get_folio(, FGP_LOCK) --- lock folio
> - truncate_inode_partial_folio
> - folio_wait_writeback --- wait on writeback being cleared
> - do_garbage_collect
> - move_data_page
> - f2fs_get_lock_data_folio
> - lock on folio --- blocked on folio's lock
>
> [...]

Here is the summary with links:
- [f2fs-dev] f2fs: fix potential deadlock in gc_merge path of f2fs_balance_fs()
https://git.kernel.org/jaegeuk/f2fs/c/cf69827e772c

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html