All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Wenjie Qi <qwjhust@gmail.com>, jaegeuk@kernel.org
Cc: linux-kernel@vger.kernel.org, qiwenjie@xiaomi.com,
	stable@kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs: only redirty pinned folios in redirty_blocks
Date: Mon, 3 Aug 2026 16:38:06 +0800	[thread overview]
Message-ID: <4e5ffe9b-6f93-4210-95cb-918686c17639@kernel.org> (raw)
In-Reply-To: <20260727130430.2109181-1-qiwenjie@xiaomi.com>

On 7/27/26 21:04, Wenjie Qi wrote:
> redirty_blocks() pins folios with read_cache_folio() and then walks the
> same range again with filemap_lock_folio() to redirty them and drop the
> references it took.
> 
> Commit 5951fee46bef ("f2fs: Use a folio in redirty_blocks()") changed
> the second pass to a do/while loop. If read_cache_folio() fails before
> anything is pinned, page_idx does not advance but the cleanup loop still
> runs once.
> 
> If readahead has already populated the failed folio in page cache, that
> extra iteration finds it and folio_put_refs(folio, 2) drops one
> reference too many. Later drop_caches or reclaim can then report
> "BUG: Bad page state".
> 
> Only redirty the range that was pinned successfully.
> 
> Fixes: 5951fee46bef ("f2fs: Use a folio in redirty_blocks()")
> Cc: stable@kernel.org
> Assisted-by: Codex:gpt-5.5
> Signed-off-by: Wenjie Qi <qiwenjie@xiaomi.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Chao Yu <chao@kernel.org>
To: Wenjie Qi <qwjhust@gmail.com>, jaegeuk@kernel.org
Cc: chao@kernel.org, stable@kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, qiwenjie@xiaomi.com
Subject: Re: [PATCH] f2fs: only redirty pinned folios in redirty_blocks
Date: Mon, 3 Aug 2026 16:38:06 +0800	[thread overview]
Message-ID: <4e5ffe9b-6f93-4210-95cb-918686c17639@kernel.org> (raw)
In-Reply-To: <20260727130430.2109181-1-qiwenjie@xiaomi.com>

On 7/27/26 21:04, Wenjie Qi wrote:
> redirty_blocks() pins folios with read_cache_folio() and then walks the
> same range again with filemap_lock_folio() to redirty them and drop the
> references it took.
> 
> Commit 5951fee46bef ("f2fs: Use a folio in redirty_blocks()") changed
> the second pass to a do/while loop. If read_cache_folio() fails before
> anything is pinned, page_idx does not advance but the cleanup loop still
> runs once.
> 
> If readahead has already populated the failed folio in page cache, that
> extra iteration finds it and folio_put_refs(folio, 2) drops one
> reference too many. Later drop_caches or reclaim can then report
> "BUG: Bad page state".
> 
> Only redirty the range that was pinned successfully.
> 
> Fixes: 5951fee46bef ("f2fs: Use a folio in redirty_blocks()")
> Cc: stable@kernel.org
> Assisted-by: Codex:gpt-5.5
> Signed-off-by: Wenjie Qi <qiwenjie@xiaomi.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

  reply	other threads:[~2026-08-03  8:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27 13:04 [PATCH] f2fs: only redirty pinned folios in redirty_blocks Wenjie Qi
2026-07-27 13:04 ` [f2fs-dev] " Wenjie Qi
2026-08-03  8:38 ` Chao Yu via Linux-f2fs-devel [this message]
2026-08-03  8:38   ` Chao Yu
2026-08-05 21:20 ` [f2fs-dev] " patchwork-bot+f2fs--- via Linux-f2fs-devel
2026-08-05 21:20   ` patchwork-bot+f2fs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e5ffe9b-6f93-4210-95cb-918686c17639@kernel.org \
    --to=linux-f2fs-devel@lists.sourceforge.net \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiwenjie@xiaomi.com \
    --cc=qwjhust@gmail.com \
    --cc=stable@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.