Re: [PATCH] f2fs: compress: fix to wait page writeback in f2fs_write_raw_pages()

From: Christoph Hellwig
Date: Mon Mar 20 2023 - 09:44:23 EST


On Thu, Mar 16, 2023 at 05:36:32PM +0800, Yangtao Li wrote:
> + if (PageWriteback(cc->rpages[i])) {
> + if (wbc->sync_mode != WB_SYNC_NONE)
> + f2fs_wait_on_page_writeback(cc->rpages[i],
> + DATA, true, true);
> + else
> + goto continue_unlock;

Please avoid the else by doing the goto in the branch:

if (PageWriteback(cc->rpages[i])) {
if (wbc->sync_mode == WB_SYNC_NONE)
goto continue_unlock;
f2fs_wait_on_page_writeback(cc->rpages[i], DATA, true,
true);