From: Li Nan <linan666@huaweicloud.com>
To: Yu Kuai <yukuai@fnnas.com>,
axboe@kernel.dk, linux-block@vger.kernel.org,
linux-raid@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, xni@redhat.com
Subject: Re: [PATCH 2/2] md/md-llbitmap: fix percpu_ref not resurrected on suspend timeout
Date: Sat, 24 Jan 2026 09:58:28 +0800 [thread overview]
Message-ID: <85477dfd-708c-44f8-26ee-19d3328fb9ae@huaweicloud.com> (raw)
In-Reply-To: <20260123182623.3718551-3-yukuai@fnnas.com>
在 2026/1/24 2:26, Yu Kuai 写道:
> When llbitmap_suspend_timeout() times out waiting for percpu_ref to
> become zero, it returns -ETIMEDOUT without resurrecting the percpu_ref.
> The caller (md_llbitmap_daemon_fn) then continues to the next page
> without calling llbitmap_resume(), leaving the percpu_ref in a killed
> state permanently.
>
> Fix this by resurrecting the percpu_ref before returning the error,
> ensuring the page control structure remains usable for subsequent
> operations.
>
> Fixes: 5ab829f1971d ("md/md-llbitmap: introduce new lockless bitmap")
> Signed-off-by: Yu Kuai <yukuai@fnnas.com>
> ---
> drivers/md/md-llbitmap.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/md/md-llbitmap.c b/drivers/md/md-llbitmap.c
> index b482a1db0861..7df15756142d 100644
> --- a/drivers/md/md-llbitmap.c
> +++ b/drivers/md/md-llbitmap.c
> @@ -779,8 +779,10 @@ static int llbitmap_suspend_timeout(struct llbitmap *llbitmap, int page_idx)
> percpu_ref_kill(&pctl->active);
>
> if (!wait_event_timeout(pctl->wait, percpu_ref_is_zero(&pctl->active),
> - llbitmap->mddev->bitmap_info.daemon_sleep * HZ))
> + llbitmap->mddev->bitmap_info.daemon_sleep * HZ)) {
> + percpu_ref_resurrect(&pctl->active);
> return -ETIMEDOUT;
> + }
>
> return 0;
> }
LGTM
Reviewed-by: Li Nan <linan122@huawei.com>
--
Thanks,
Nan
next prev parent reply other threads:[~2026-01-24 1:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 18:26 [PATCH 0/2] md/md-llbimtap: fix two corner case problems Yu Kuai
2026-01-23 18:26 ` [PATCH 1/2] md/raid5: fix IO hang with degraded array with llbitmap Yu Kuai
2026-01-24 6:42 ` Li Nan
2026-01-23 18:26 ` [PATCH 2/2] md/md-llbitmap: fix percpu_ref not resurrected on suspend timeout Yu Kuai
2026-01-24 1:58 ` Li Nan [this message]
2026-01-24 3:38 ` [PATCH 0/2] md/md-llbimtap: fix two corner case problems Jens Axboe
2026-01-24 15:04 ` Yu Kuai
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=85477dfd-708c-44f8-26ee-19d3328fb9ae@huaweicloud.com \
--to=linan666@huaweicloud.com \
--cc=axboe@kernel.dk \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=xni@redhat.com \
--cc=yukuai@fnnas.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®