[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <85477dfd-708c-44f8-26ee-19d3328fb9ae@huaweicloud.com>
Date: Sat, 24 Jan 2026 09:58:28 +0800
From: Li Nan <linan666@...weicloud.com>
To: Yu Kuai <yukuai@...as.com>, axboe@...nel.dk, linux-block@...r.kernel.org,
linux-raid@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, xni@...hat.com
Subject: Re: [PATCH 2/2] md/md-llbitmap: fix percpu_ref not resurrected on
suspend timeout
在 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@...as.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@...wei.com>
--
Thanks,
Nan
Powered by blists - more mailing lists