mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Hongling Zeng <zenghongling@kylinos.cn>,
	clm@fb.com, dsterba@suse.com, boris@bur.io, willy@infradead.org
Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	zhongling0719@126.com, stable@vger.kernel.org
Subject: Re: [PATCH] btrfs: fix missing folio_unlock in read_merkle_tree_page error path
Date: Mon, 17 Aug 2026 16:13:37 +0930	[thread overview]
Message-ID: <72e6138f-3c9e-4094-a746-bd1e4c6f1558@suse.com> (raw)
In-Reply-To: <20260817053607.46939-1-zenghongling@kylinos.cn>



在 2026/8/17 15:06, Hongling Zeng 写道:
> filemap_add_folio() adds the folio to the page cache and leaves it locked.
> If read_key_bytes() fails, the error path only calls folio_put() without
> first unlocking the folio, leaving it permanently locked in the page cache.
> This causes subsequent attempts to lock this folio to hang.
> 
> Fix by adding folio_unlock() before folio_put() in the error handling path.
> 
> Fixes: 06ed09351b67 ("btrfs: convert btrfs_read_merkle_tree_page() to use a folio")
> Cc: stable@vger.kernel.org
> Assisted-by: Codex:gpt-5.5
> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>

A fix is already submitted and merged:

https://lore.kernel.org/linux-btrfs/20260722025435.1493093-1-chenyichong@uniontech.com/

Next time let your agent to read the btrfs developer's note and check if 
there is already a fix:

https://btrfs.readthedocs.io/en/latest/dev/Developer-s-FAQ.html#development-phase-linux-next-for-next

> ---
>   fs/btrfs/verity.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/fs/btrfs/verity.c b/fs/btrfs/verity.c
> index 983365a73541..4431656140f8 100644
> --- a/fs/btrfs/verity.c
> +++ b/fs/btrfs/verity.c
> @@ -753,6 +753,7 @@ static struct page *btrfs_read_merkle_tree_page(struct inode *inode,
>   	ret = read_key_bytes(BTRFS_I(inode), BTRFS_VERITY_MERKLE_ITEM_KEY, off,
>   			     folio_address(folio), PAGE_SIZE, folio);
>   	if (ret < 0) {
> +		folio_unlock(folio);
>   		folio_put(folio);
>   		return ERR_PTR(ret);
>   	}


  reply	other threads:[~2026-08-17  6:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17  5:36 Hongling Zeng
2026-08-17  6:43 ` Qu Wenruo [this message]
2026-08-17  6:51   ` Hongling Zeng

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=72e6138f-3c9e-4094-a746-bd1e4c6f1558@suse.com \
    --to=wqu@suse.com \
    --cc=boris@bur.io \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=willy@infradead.org \
    --cc=zenghongling@kylinos.cn \
    --cc=zhongling0719@126.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®